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

From: Matthew Wilcox

Date: Mon Feb 23 2026 - 10:17:10 EST


On Fri, Feb 20, 2026 at 06:12:43PM +0530, Sanjay Chitroda wrote:
> 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

Usually we keep the kernel-doc comment with the implementation, not with
the prototype.