Re: [PATCH] mm/slub: drop duplicate kernel-doc for ksize()

From: David Rientjes

Date: Sat Feb 21 2026 - 22:47:59 EST


On Fri, 20 Feb 2026, Sanjay Chitroda wrote:

> From: Sanjay Chitroda <sanjayembeddedse@xxxxxxxxx>
>
> The ksize() API is already documented in the public header, and
> Documentation/core-api/mm-api.rst pulls that canonical doc into the
> book. The kernel-doc block added to mm/slub.c by commit
> fab0694646d7 ("mm/slab: move [__]ksize and slab_ksize() to mm/slub.c")
> introduced a second definition for the same symbol in the generated
> docs, which makes Sphinx emit:
>
> WARNING: Duplicate C declaration, also defined at core-api/mm-api:521
> Declaration is '.. c:function:: size_t ksize(const void *objp)'
>
> Remove the redundant kernel-doc comment from slub.c so only the
> header-provided documentation is emitted. This keeps the user-visible
> API documentation intact while eliminating the duplicate-declaration
> warning during `make htmldocs`.
>
> No functional change.
>
> Fixes: fab0694646d7 ("mm/slab: move [__]ksize and slab_ksize() to mm/slub.c")
> Signed-off-by: Sanjay Chitroda <sanjayembeddedse@xxxxxxxxx>

The header file kernel-doc looks equivalent without mentioning that it
returns bytes. Might be best to make that clear in slab.h?