Skip to content

Commit 6a27383

Browse files
gmarullcarlescufi
authored andcommitted
scripts: checkpatch: allow parentheses around operators
Some macros, e.g., FOR_EACH_FIXED_ARG, require a separator argument that needs to be in parentheses, e.g., (||). This should not trigger a checkpatch warning. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent adc901a commit 6a27383

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/checkpatch.pl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4726,6 +4726,13 @@ sub process {
47264726
$ok = 1;
47274727
}
47284728

4729+
# some macros require a separator
4730+
# argument to be in parentheses,
4731+
# e.g. (||).
4732+
if ($ca =~ /\($/ || $cc =~ /^\)/) {
4733+
$ok = 1;
4734+
}
4735+
47294736
# messages are ERROR, but ?: are CHK
47304737
if ($ok == 0) {
47314738
my $msg_level = \&ERROR;

0 commit comments

Comments
 (0)