Thread (35 messages) 35 messages, 3 authors, 20d ago

Re: [PATCH v2 12/24] dyndbg: drop NUM_TYPE_ARGS

From: sashiko-bot@kernel.org
Date: 2026-05-23 07:32:36

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 [off-list ref]

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.
quoted hunk ↗ jump to hunk
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,			\
 	}
[ ... ]
quoted hunk ↗ jump to hunk
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/20260523-dd-maint-2-v2-0-b937312aa083@gmail.com?part=12
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help