Re: [PATCH v6 10/24] dyndbg: drop NUM_TYPE_ARGS

[email protected] Wed, 08 Jul 2026 02:24:24 +0000
Newsgroups org.kernel.vger.linux-modules,org.freedesktop.lists.dri-devel
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The newly defined macro __DDEBUG_ARRAY_SIZE is unused because the array size calculation is manually open-coded.
--

--- Patch [10]: [PATCH v6 10/24] dyndbg: drop NUM_TYPE_ARGS ---
commit 0ca0f4a344ab62c4d4df9c27a60daf65fecad136
Author: Jim Cromie <[email protected]>

dyndbg: drop NUM_TYPE_ARGS

This commit removes the NUM_TYPE_ARGS macro and replaces it with an array
size calculation. The commit message mentions adding a new local macro named
__DDEBUG_ARRAY_SIZE to handle this without causing include conflicts.

> diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
> index 9607121c3072e..9ae1accb9bf63 100644
> --- a/include/linux/dynamic_debug.h
> +++ b/include/linux/dynamic_debug.h
> @@ -8,6 +8,8 @@
>  
>  #include <linux/build_bug.h>
>  
> +#define __DDEBUG_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
> +

[ ... ]

> @@ -122,11 +124,9 @@ struct ddebug_class_param {
>  		.mod_name = KBUILD_MODNAME,				\
>  		.base = _base,						\
>  		.map_type = _maptype,					\
> -		.length = NUM_TYPE_ARGS(char*, __VA_ARGS__),		\
> +		.length = (sizeof(_var##_classnames) / sizeof(_var##_classnames[0])), \

[Severity: Low]
This isn't a bug, but should this line use the new __DDEBUG_ARRAY_SIZE macro
introduced above? The calculation appears to be manually open-coded here,
leaving the newly defined macro unused.

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

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