Skip to content

Commit df3d527

Browse files
jimcakpm00
authored andcommitted
checkpatch: dont warn about unused macro arg on empty body
Patch series "2 checkpatch fixes, one pr_info_once". 2 small tweaks to checkpatch, 1 reducing several pages of powernow "not-relevant-here" log-msgs to a few lines This patch (of 3): We currently get: WARNING: Argument 'name' is not used in function-like macro on: #define DRM_CLASSMAP_USE(name) /* nothing here */ Following this advice is wrong here, and shouldn't be fixed by ignoring args altogether; the macro should properly fail if invoked with 0 or 2+ args. Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Jim Cromie <[email protected]> Acked-by: Joe Perches <[email protected]> Reviewed-by: Louis Chauvet <[email protected]> Cc: Andy Whitcroft <[email protected]> Cc: Joe Perches <[email protected]> Cc: Dwaipayan Ray <[email protected]> Cc: Lukas Bulwahn <[email protected]> Cc:"Rafael J. Wysocki" <[email protected]> Cc: Viresh Kumar <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 65c6604 commit df3d527

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/checkpatch.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6024,7 +6024,7 @@ sub process {
60246024
}
60256025

60266026
# check if this is an unused argument
6027-
if ($define_stmt !~ /\b$arg\b/) {
6027+
if ($define_stmt !~ /\b$arg\b/ && $define_stmt) {
60286028
WARN("MACRO_ARG_UNUSED",
60296029
"Argument '$arg' is not used in function-like macro\n" . "$herectx");
60306030
}

0 commit comments

Comments
 (0)