From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
To: Sanjay Chitroda <sanjayembeddedse@gmail.com>,
Vlastimil Babka <vbabka@suse.cz>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Lameter <cl@gentwo.org>,
David Rientjes <rientjes@google.com>,
Roman Gushchin <roman.gushchin@linux.dev>,
Harry Yoo <harry.yoo@oracle.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mm/slub: drop duplicate kernel-doc for ksize()
Date: Thu, 26 Feb 2026 11:06:52 +0100 [thread overview]
Message-ID: <05d4df12-f9df-44e4-8df6-04518bb679cf@kernel.org> (raw)
In-Reply-To: <20260226054712.3610744-1-sanjayembedded@gmail.com>
On 2/26/26 06:47, Sanjay Chitroda wrote:
> From: Sanjay Chitroda <sanjayembeddedse@gmail.com>
>
> 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>
Thanks, added to slab/for-next-fixes
> ---
> Changes in v2:
> - Instead of removing the doc comment from slub.c, remove it from the
> public header as suggested by reviewers.
> - Follow the guideline that kernel-doc should stay with the implementation.
> - Updated commit message accordingly.
> - Link to v1 https://lore.kernel.org/all/20260220124243.3264133-1-sanjayembedded@gmail.com/
> ---
> include/linux/slab.h | 12 ------------
> 1 file changed, 12 deletions(-)
>
> diff --git a/include/linux/slab.h b/include/linux/slab.h
> index c5fde8740281..1c8c53b068b6 100644
> --- a/include/linux/slab.h
> +++ b/include/linux/slab.h
> @@ -517,18 +517,6 @@ void kfree_sensitive(const void *objp);
> DEFINE_FREE(kfree, void *, if (!IS_ERR_OR_NULL(_T)) kfree(_T))
> DEFINE_FREE(kfree_sensitive, void *, if (_T) kfree_sensitive(_T))
>
> -/**
> - * ksize - Report actual allocation size of associated object
> - *
> - * @objp: Pointer returned from a prior kmalloc()-family allocation.
> - *
> - * This should not be used for writing beyond the originally requested
> - * allocation size. Either use krealloc() or round up the allocation size
> - * with kmalloc_size_roundup() prior to allocation. If this is used to
> - * access beyond the originally requested allocation size, UBSAN_BOUNDS
> - * and/or FORTIFY_SOURCE may trip, since they only know about the
> - * originally allocated size via the __alloc_size attribute.
> - */
> size_t ksize(const void *objp);
>
> #ifdef CONFIG_PRINTK
prev parent reply other threads:[~2026-02-26 10:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 5:47 Sanjay Chitroda
2026-02-26 10:06 ` Vlastimil Babka (SUSE) [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=05d4df12-f9df-44e4-8df6-04518bb679cf@kernel.org \
--to=vbabka@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=cl@gentwo.org \
--cc=harry.yoo@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=sanjayembeddedse@gmail.com \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox