Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Low] `include/linux/dynamic_debug.h` uses `ARRAY_SIZE` in the 
`DECLARE_DYNDBG_CLASSMAP` macro but does not include `<linux/array_size.h>`.
--

commit 618a01dd2902c43678e5c0a9f07fd35aaf566937
Author: Jim Cromie <[email protected]>

dyndbg: drop NUM_TYPE_ARGS

This commit drops the NUM_TYPE_ARGS macro and replaces it with ARRAY_SIZE in
the DECLARE_DYNDBG_CLASSMAP macro.

> diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
> --- a/include/linux/dynamic_debug.h
> +++ b/include/linux/dynamic_debug.h
> @@ -121,11 +121,9 @@ struct ddebug_class_param {
>               .mod_name = KBUILD_MODNAME,                             \
>               .base = _base,                                          \
>               .map_type = _maptype,                                   \
> -             .length = NUM_TYPE_ARGS(char*, __VA_ARGS__),            \
> +             .length = ARRAY_SIZE(_var##_classnames),                \

[Severity: Low]
Does this macro expansion require linux/array_size.h to be included directly
in include/linux/dynamic_debug.h?

If a driver or module includes linux/dynamic_debug.h and invokes
DECLARE_DYNDBG_CLASSMAP without independently including linux/array_size.h
(for example, via linux/kernel.h), it might fail to compile. It looks like
the include for linux/array_size.h was added to lib/dynamic_debug.c below,
instead of to this header file.

>               .class_names = _var##_classnames,                       \
>       }

[ ... ]

> diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
> --- a/lib/dynamic_debug.c
> +++ b/lib/dynamic_debug.c
> @@ -13,6 +13,7 @@
>  
>  #define pr_fmt(fmt) "dyndbg: " fmt
>  
> +#include <linux/array_size.h>
>  #include <linux/kernel.h>
>  #include <linux/module.h>
>  #include <linux/moduleparam.h>

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=12

Reply via email to