Re: [PATCH] mm/slub: drop duplicate kernel-doc for ksize()
From: Sanjay Chitroda
Date: Mon Feb 23 2026 - 22:44:16 EST
On 23 February 2026 8:46:42 pm IST, Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote:
>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.
I agree with you, Kernel-doc comment should be present with implementation.
I have observed that multiple kernel-doc comments are there in slab.h with prototype, would you suggest to replace all possible at once ?
Or with reference to reported warning; we can keep kernel-doc with implementation and remove from prototype and rectify commit message to highlight ideal kernel-doc practice along with existing commit details so context would be better clear and relavent.