All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/slab: fix kcalloc() kernel-doc warnings
@ 2024-03-27  4:46 Randy Dunlap
  2024-03-27  5:49 ` Suren Baghdasaryan
  0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2024-03-27  4:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Stephen Rothwell, Suren Baghdasaryan,
	Kent Overstreet, Vlastimil Babka, Andrew Morton, linux-mm

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")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Link: https://lore.kernel.org/linux-next/20240325123603.1bdd6588@canb.auug.org.au/
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org
---
 include/linux/slab.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -- a/include/linux/slab.h b/include/linux/slab.h
--- 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);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm/slab: fix kcalloc() kernel-doc warnings
  2024-03-27  4:46 [PATCH] mm/slab: fix kcalloc() kernel-doc warnings Randy Dunlap
@ 2024-03-27  5:49 ` Suren Baghdasaryan
  0 siblings, 0 replies; 2+ messages in thread
From: Suren Baghdasaryan @ 2024-03-27  5:49 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-kernel, Stephen Rothwell, Kent Overstreet, Vlastimil Babka,
	Andrew Morton, linux-mm

On Tue, Mar 26, 2024 at 9:46 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> 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")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Link: https://lore.kernel.org/linux-next/20240325123603.1bdd6588@canb.auug.org.au/
> Cc: Suren Baghdasaryan <surenb@google.com>
> Cc: Kent Overstreet <kent.overstreet@linux.dev>
> Cc: Vlastimil Babka <vbabka@suse.cz>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: linux-mm@kvack.org

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

Tested-by: Suren Baghdasaryan <surenb@google.com>


> ---
>  include/linux/slab.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff -- a/include/linux/slab.h b/include/linux/slab.h
> --- 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);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-27  5:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-27  4:46 [PATCH] mm/slab: fix kcalloc() kernel-doc warnings Randy Dunlap
2024-03-27  5:49 ` Suren Baghdasaryan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.