aboutsummaryrefslogtreecommitdiff
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2024-05-14 14:16:15 -0700
committerAndrew Morton <akpm@linux-foundation.org>2024-05-14 14:16:15 -0700
commit529891be59970ad787ac4afa87be3ccafde29902 (patch)
tree1483bdc21632920396b841552f07ee703365d19f /scripts/checkpatch.pl
parent3bdfa4905791dfbecbb769b856859924e9ca1d5d (diff)
parentf8fe09c684ea8f4bf5b1c8cf16015728fd2a78d8 (diff)
foo
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 9c4c4a61bc83..2b812210b412 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -6040,6 +6040,12 @@ sub process {
CHK("MACRO_ARG_PRECEDENCE",
"Macro argument '$arg' may be better as '($arg)' to avoid precedence issues\n" . "$herectx");
}
+
+# check if this is an unused argument
+ if ($define_stmt !~ /\b$arg\b/) {
+ WARN("MACRO_ARG_UNUSED",
+ "Argument '$arg' is not used in function-like macro\n" . "$herectx");
+ }
}
# check for macros with flow control, but without ## concatenation