2024-03-29 23:09:01

by Charlemagne Lasse

[permalink] [raw]
Subject: Re: [PATCH v3 2/2] scripts: checkpatch: check unused parameters for function-like macro

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); })


2024-03-30 02:49:39

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH v3 2/2] scripts: checkpatch: check unused parameters for function-like macro

On Sat, 2024-03-30 at 00:08 +0100, Charlemagne Lasse wrote:
> 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:

I agree it was a bit early to add to -mm but
there is a fix for (most of) that coming up.