Skip to content

Commit

Permalink
checkpatch: improve operator spacing check
Browse files Browse the repository at this point in the history
Code such as:
       x = timercmp(&now, &end, <);
Will currently trigger a checkpatch error. e.g.

ERROR: spaces required around that '<'

This is because the "Ignore operators passed as parameters" check looks
only for a comma following the operator.  Improve the check by also
looking for a close parenthesis.

Signed-off-by: Sam Bobroff <[email protected]>
Cc: Joe Perches <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
sambltc authored and torvalds committed Apr 17, 2015
1 parent b598b67 commit d7fe806
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3652,7 +3652,7 @@ sub process {

# Ignore operators passed as parameters.
if ($op_type ne 'V' &&
$ca =~ /\s$/ && $cc =~ /^\s*,/) {
$ca =~ /\s$/ && $cc =~ /^\s*[,\)]/) {

# # Ignore comments
# } elsif ($op =~ /^$;+$/) {
Expand Down

0 comments on commit d7fe806

Please sign in to comment.