Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/slub: drop duplicate kernel-doc for ksize()

The implementation of ksize() was updated with kernel-doc by commit
fab0694646d7 ("mm/slab: move [__]ksize and slab_ksize() to mm/slub.c")
However, the public header still contains a kernel-doc comment
attached to the ksize() prototype.

Having documentation both in the header and next to the implementation
causes Sphinx to treat the function as being documented twice,
resulting in the warning:

WARNING: Duplicate C declaration, also defined at core-api/mm-api:521
Declaration is '.. c:function:: size_t ksize(const void *objp)'

Kernel-doc guidelines recommend keeping the documentation with the
function implementation. Therefore remove the redundant kernel-doc
block from include/linux/slab.h so that the implementation in slub.c
remains the canonical source for documentation.

No functional change.

Fixes: fab0694646d7 ("mm/slab: move [__]ksize and slab_ksize() to mm/slub.c")
Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
Link: https://patch.msgid.link/20260226054712.3610744-1-sanjayembedded@gmail.com
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>

authored by

Sanjay Chitroda and committed by
Vlastimil Babka (SUSE)
2b351ea4 f3ec502b

-12
-12
include/linux/slab.h
··· 517 517 DEFINE_FREE(kfree, void *, if (!IS_ERR_OR_NULL(_T)) kfree(_T)) 518 518 DEFINE_FREE(kfree_sensitive, void *, if (_T) kfree_sensitive(_T)) 519 519 520 - /** 521 - * ksize - Report actual allocation size of associated object 522 - * 523 - * @objp: Pointer returned from a prior kmalloc()-family allocation. 524 - * 525 - * This should not be used for writing beyond the originally requested 526 - * allocation size. Either use krealloc() or round up the allocation size 527 - * with kmalloc_size_roundup() prior to allocation. If this is used to 528 - * access beyond the originally requested allocation size, UBSAN_BOUNDS 529 - * and/or FORTIFY_SOURCE may trip, since they only know about the 530 - * originally allocated size via the __alloc_size attribute. 531 - */ 532 520 size_t ksize(const void *objp); 533 521 534 522 #ifdef CONFIG_PRINTK