From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC6323A1A5F for ; Thu, 26 Feb 2026 10:06:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772100417; cv=none; b=AHC/VoDrvTlyCcccac49aiTQfPX4nSPo9Xgtxl2XK0HthA392jUTA9Nbpm1cBQYhUrpFI7Z7FYKs9RTkhnv+dmMMK0z2dw1iNCrvPodEzPbECyde1O2hj0yrDzR7Z8M5N0ehk3t+2FIl3bSkLiRUKPxUqdZ6soPfpcgco0DrX9E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772100417; c=relaxed/simple; bh=354C65bvPjF3i1kcqCpygsKJwJ/HUCRMp6MPAidxgoI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=tmLdepJMlbWiFHnSao7erdIhs7nP/JN3MUfLvGaFZ+myS7shG2xTab/BXQKC9x50zJA7EKG0t1RlT6JlsIMH68miNO8Ng63nSt9KvXvIOvnJCNQlxl1/csWzYHU8nkdj7OvuJJCu5E68FdpBxwCmzlkocTlfsdUMqHIAmr/4vI0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=r27eNEsg; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="r27eNEsg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99115C19422; Thu, 26 Feb 2026 10:06:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772100416; bh=354C65bvPjF3i1kcqCpygsKJwJ/HUCRMp6MPAidxgoI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=r27eNEsgfjntCCajF+dXVdQZUWZFbywXhb0U9gcJrpEDAEjA8bXUKv2YfiTlfaL+n r5IwOr6WD5aa9wuxvxdKiBnAfYa7Jo1MgICGPG/QjpjQQgSyEg6k6eAwbsQhdC03pt TZb/1IlBr/l6YRrz8+0IQCqBqg2H/VIWs6zDY8bw8Sonc/bMy0oV2k83ZsgMy57zU5 lJXB5GKnXD5T0lUSQE2PuJVgki8mwEAST0aH/B7h9FNXXa10t01NON9Cb6L70gDAD4 nIvDihMB1suMPRXjbaf/nxMCG3VNWrGBcRC+HuaID1ozdqPMcrK+rLA3tr3g1CT+Hc sQsNvkrmLQLEg== Message-ID: <05d4df12-f9df-44e4-8df6-04518bb679cf@kernel.org> Date: Thu, 26 Feb 2026 11:06:52 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] mm/slub: drop duplicate kernel-doc for ksize() Content-Language: en-US To: Sanjay Chitroda , Vlastimil Babka , Andrew Morton Cc: Christoph Lameter , David Rientjes , Roman Gushchin , Harry Yoo , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20260226054712.3610744-1-sanjayembedded@gmail.com> From: "Vlastimil Babka (SUSE)" In-Reply-To: <20260226054712.3610744-1-sanjayembedded@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2/26/26 06:47, Sanjay Chitroda wrote: > From: Sanjay Chitroda > > 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 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