Re: [PATCH v3 2/2] scripts: checkpatch: check unused parameters for function-like macro
From: Charlemagne Lasse
Date: Fri Mar 29 2024 - 19:08:56 EST
Hi,
Can this patch please be dropped from Linux-next (currently via
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm#mm-everything)?
It is obviously wrong when dealing with named variadic macro
parameters:
./scripts/checkpatch.pl -f include/linux/rculist.h
ERROR: Parameter 'dummy' is not used in function-like macro, please
use static inline instead
#51: FILE: include/linux/rculist.h:51:
+#define __list_check_rcu(dummy, cond, extra...)
\
+ ({ \
+ check_arg_count_one(extra); \
+ RCU_LOCKDEP_WARN(!(cond) && !rcu_read_lock_any_held(), \
+ "RCU-list traversed in non-reader section!"); \
+ })
ERROR: Parameter 'extra...' is not used in function-like macro, please
use static inline instead
#51: FILE: include/linux/rculist.h:51:
+#define __list_check_rcu(dummy, cond, extra...)
\
+ ({ \
+ check_arg_count_one(extra); \
+ RCU_LOCKDEP_WARN(!(cond) && !rcu_read_lock_any_held(), \
+ "RCU-list traversed in non-reader section!"); \
+ })
ERROR: Parameter 'dummy' is not used in function-like macro, please
use static inline instead
#64: FILE: include/linux/rculist.h:64:
+#define __list_check_rcu(dummy, cond, extra...)
\
+ ({ check_arg_count_one(extra); })
ERROR: Parameter 'cond' is not used in function-like macro, please use
static inline instead
#64: FILE: include/linux/rculist.h:64:
+#define __list_check_rcu(dummy, cond, extra...)
\
+ ({ check_arg_count_one(extra); })
ERROR: Parameter 'extra...' is not used in function-like macro, please
use static inline instead
#64: FILE: include/linux/rculist.h:64:
+#define __list_check_rcu(dummy, cond, extra...)
\
+ ({ check_arg_count_one(extra); })