[PATCH 15/63] checkpatch: add an exception to the do-while wrapper advice

Jim Cromie posted 63 patches 1 year ago
There is a newer version of this series
[PATCH 15/63] checkpatch: add an exception to the do-while wrapper advice
Posted by Jim Cromie 1 year ago
Several new DYNDBG_CLASSMAP_* macros (added in following commits)
expand to multi-statement declarations, like module_param_named does.
They are invoked in file-scope, not in function scope, and cannot be
wrapped by a do-while, so add an exception by name for them.

cc: Andy Whitcroft <apw@canonical.com>
cc: Joe Perches <joe@perches.com>
cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
 scripts/checkpatch.pl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 9eed3683ad76..4a93b2ede8cd 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5963,6 +5963,7 @@ sub process {
 				MODULE_PARM_DESC|
 				DECLARE_PER_CPU|
 				DEFINE_PER_CPU|
+				DYNDBG_CLASSMAP|
 				__typeof__\(|
 				union|
 				struct|
-- 
2.48.1
Re: [PATCH 15/63] checkpatch: add an exception to the do-while wrapper advice
Posted by Louis Chauvet 11 months, 2 weeks ago

Le 25/01/2025 à 07:45, Jim Cromie a écrit :
> Several new DYNDBG_CLASSMAP_* macros (added in following commits)
> expand to multi-statement declarations, like module_param_named does.
> They are invoked in file-scope, not in function scope, and cannot be
> wrapped by a do-while, so add an exception by name for them.
> 
> cc: Andy Whitcroft <apw@canonical.com>
> cc: Joe Perches <joe@perches.com>
> cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
> cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
> Signed-off-by: Jim Cromie <jim.cromie@gmail.com>

Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>

> ---
>   scripts/checkpatch.pl | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 9eed3683ad76..4a93b2ede8cd 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -5963,6 +5963,7 @@ sub process {
>   				MODULE_PARM_DESC|
>   				DECLARE_PER_CPU|
>   				DEFINE_PER_CPU|
> +				DYNDBG_CLASSMAP|
>   				__typeof__\(|
>   				union|
>   				struct|

-- 
Louis Chauvet, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com