Skip to content

Commit

Permalink
tests: update checkpatch.pl from Linux kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos committed Jun 2, 2024
1 parent 388fa98 commit 5155b2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/ci/checkpatch/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/ci/checkpatch/const_structs.checkpatch
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ kgdb_arch
kgdb_io
kobj_type
kset_uevent_ops
lcd_ops
lock_manager_operations
machine_desc
microcode_ops
Expand Down

0 comments on commit 5155b2d

Please sign in to comment.