summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorVlastimil Babka <vbabka@suse.cz>2022-11-07 17:11:27 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-04-10 14:32:06 +0200
commit3e47f3a703c63aca1e1309f9d67c263303dddc34 (patch)
treefad51d064d237c2b4c5bf2b76d6f61647d3f43f4 /mm
parentc1030da07a2445cec4b2a5f00b6d6e9d28fbf9ff (diff)
downloadlinux-3e47f3a703c63aca1e1309f9d67c263303dddc34.tar.gz
linux-3e47f3a703c63aca1e1309f9d67c263303dddc34.tar.bz2
linux-3e47f3a703c63aca1e1309f9d67c263303dddc34.zip
mm, slab: remove duplicate kernel-doc comment for ksize()
commit c18c20f16219516b12a4f2fd29c25e06be97e064 upstream. Akira reports: > "make htmldocs" reports duplicate C declaration of ksize() as follows: > /linux/Documentation/core-api/mm-api:43: ./mm/slab_common.c:1428: WARNING: Duplicate C declaration, also defined at core-api/mm-api:212. > Declaration is '.. c:function:: size_t ksize (const void *objp)'. > This is due to the kernel-doc comment for ksize() declaration added in > include/linux/slab.h by commit 05a940656e1e ("slab: Introduce > kmalloc_size_roundup()"). There is an older kernel-doc comment for ksize() definition in mm/slab_common.c, which is not only duplicated, but also contradicts the new one - the additional storage discovered by ksize() should not be used by callers anymore. Delete the old kernel-doc. Reported-by: Akira Yokosawa <akiyks@gmail.com> Link: https://lore.kernel.org/all/d33440f6-40cf-9747-3340-e54ffaf7afb8@gmail.com/ Fixes: 05a940656e1e ("slab: Introduce kmalloc_size_roundup()") Cc: Kees Cook <keescook@chromium.org> Signed-off-by: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/slab_common.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 06958c613b0a..315e83f5daea 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -1305,20 +1305,6 @@ void kfree_sensitive(const void *p)
}
EXPORT_SYMBOL(kfree_sensitive);
-/**
- * ksize - get the actual amount of memory allocated for a given object
- * @objp: Pointer to the object
- *
- * kmalloc may internally round up allocations and return more memory
- * than requested. ksize() can be used to determine the actual amount of
- * memory allocated. The caller may use this additional memory, even though
- * a smaller amount of memory was initially specified with the kmalloc call.
- * The caller must guarantee that objp points to a valid object previously
- * allocated with either kmalloc() or kmem_cache_alloc(). The object
- * must not be freed during the duration of the call.
- *
- * Return: size of the actual memory used by @objp in bytes
- */
size_t ksize(const void *objp)
{
size_t size;