diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2024-05-14 14:16:15 -0700 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-05-14 14:16:15 -0700 |
commit | 529891be59970ad787ac4afa87be3ccafde29902 (patch) | |
tree | 1483bdc21632920396b841552f07ee703365d19f /scripts/checkpatch.pl | |
parent | 3bdfa4905791dfbecbb769b856859924e9ca1d5d (diff) | |
parent | f8fe09c684ea8f4bf5b1c8cf16015728fd2a78d8 (diff) |
foo
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 6 |
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 |