From 5155b2de2eb4139cc0333f107a6ca4d7312d5b8f Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Sun, 2 Jun 2024 20:19:56 +0200 Subject: [PATCH] tests: update checkpatch.pl from Linux kernel --- tests/ci/checkpatch/checkpatch.pl | 6 ++++++ tests/ci/checkpatch/const_structs.checkpatch | 1 + 2 files changed, 7 insertions(+) diff --git a/tests/ci/checkpatch/checkpatch.pl b/tests/ci/checkpatch/checkpatch.pl index 9c4c4a61..2b812210 100644 --- a/tests/ci/checkpatch/checkpatch.pl +++ b/tests/ci/checkpatch/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 diff --git a/tests/ci/checkpatch/const_structs.checkpatch b/tests/ci/checkpatch/const_structs.checkpatch index fa96cfd1..52e5bfb6 100644 --- a/tests/ci/checkpatch/const_structs.checkpatch +++ b/tests/ci/checkpatch/const_structs.checkpatch @@ -39,6 +39,7 @@ kgdb_arch kgdb_io kobj_type kset_uevent_ops +lcd_ops lock_manager_operations machine_desc microcode_ops