Skip to contentSkip to conversation

mm/slab: fix kcalloc() kernel-doc warnings

PATCH In review Randy Dunlap 2 participants 2 messages Mar 27, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/slab: fix kcalloc() kernel-doc warnings

Fix the parameter names for kcalloc() in slab.h to prevent kernel-doc warnings:

include/linux/slab.h:730: warning: Function parameter or struct member '_n' not described in 'kcalloc' include/linux/slab.h:730: warning: Function parameter or struct member '_size' not described in 'kcalloc' include/linux/slab.h:730: warning: Function parameter or struct member '_flags' not described in 'kcalloc' include/linux/slab.h:730: warning: Excess function parameter 'n' description in 'kcalloc' include/linux/slab.h:730: warning: Excess function parameter 'size' description in 'kcalloc' include/linux/slab.h:730: warning: Excess function parameter 'flags' description in 'kcalloc'

Fixes bc7b83f5e4bf ("mm/slab: enable slab allocation tagging for kmalloc and friends")
Cc Suren Baghdasaryan <[email protected]>
Cc Kent Overstreet <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Andrew Morton <[email protected]>
---
 include/linux/slab.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/slab.h +1 -1
diff -- a/include/linux/slab.h b/include/linux/slab.h
@@ -727,7 +727,7 @@ static inline __realloc_size(2, 3) void
  * @size: element size.
  * @flags: the type of memory to allocate (see kmalloc).
  */
-#define kcalloc(_n, _size, _flags)		kmalloc_array(_n, _size, (_flags) | __GFP_ZERO)
+#define kcalloc(n, size, flags)		kmalloc_array(n, size, (flags) | __GFP_ZERO)
 
 void *kmalloc_node_track_caller_noprof(size_t size, gfp_t flags, int node,
 				  unsigned long caller) __alloc_size(1);
Tested-by on v1 1/1
#1 lore raw
Quoted 11 lines · Randy Dunlap

Fix the parameter names for kcalloc() in slab.h to prevent kernel-doc warnings:

include/linux/slab.h:730: warning: Function parameter or struct member '_n' not described in 'kcalloc' include/linux/slab.h:730: warning: Function parameter or struct member '_size' not described in 'kcalloc' include/linux/slab.h:730: warning: Function parameter or struct member '_flags' not described in 'kcalloc' include/linux/slab.h:730: warning: Excess function parameter 'n' description in 'kcalloc' include/linux/slab.h:730: warning: Excess function parameter 'size' description in 'kcalloc' include/linux/slab.h:730: warning: Excess function parameter 'flags' description in 'kcalloc'

Quoted 9 lines
Fixes bc7b83f5e4bf ("mm/slab: enable slab allocation tagging for kmalloc and friends")
Cc Suren Baghdasaryan <[email protected]>
Cc Kent Overstreet <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Andrew Morton <[email protected]>

Doh! I noticed these warnings but completely forgot to fix them in my fixup patchset :(
Thanks for the fix!

Quoted 16 lines
---
 include/linux/slab.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -- a/include/linux/slab.h b/include/linux/slab.h

include/linux/slab.h +1 -1
@@ -727,7 +727,7 @@ static inline __realloc_size(2, 3) void
  * @size: element size.
  * @flags: the type of memory to allocate (see kmalloc).
  */
-#define kcalloc(_n, _size, _flags)             kmalloc_array(_n, _size, (_flags) | __GFP_ZERO)
+#define kcalloc(n, size, flags)                kmalloc_array(n, size, (flags) | __GFP_ZERO)
 
 void *kmalloc_node_track_caller_noprof(size_t size, gfp_t flags, int node,
                                  unsigned long caller) __alloc_size(1);