aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl16
1 files changed, 7 insertions, 9 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 66cad506b8a2..42103a0cdbc0 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2838,7 +2838,7 @@ sub process {
2838 \+=|-=|\*=|\/=|%=|\^=|\|=|&=| 2838 \+=|-=|\*=|\/=|%=|\^=|\|=|&=|
2839 =>|->|<<|>>|<|>|=|!|~| 2839 =>|->|<<|>>|<|>|=|!|~|
2840 &&|\|\||,|\^|\+\+|--|&|\||\+|-|\*|\/|%| 2840 &&|\|\||,|\^|\+\+|--|&|\||\+|-|\*|\/|%|
2841 \?|: 2841 \?:|\?|:
2842 }x; 2842 }x;
2843 my @elements = split(/($ops|;)/, $opline); 2843 my @elements = split(/($ops|;)/, $opline);
2844 2844
@@ -3061,15 +3061,13 @@ sub process {
3061 $ok = 1; 3061 $ok = 1;
3062 } 3062 }
3063 3063
3064 # Ignore ?: 3064 # messages are ERROR, but ?: are CHK
3065 if (($opv eq ':O' && $ca =~ /\?$/) ||
3066 ($op eq '?' && $cc =~ /^:/)) {
3067 $ok = 1;
3068 }
3069
3070 if ($ok == 0) { 3065 if ($ok == 0) {
3071 if (ERROR("SPACING", 3066 my $msg_type = \&ERROR;
3072 "spaces required around that '$op' $at\n" . $hereptr)) { 3067 $msg_type = \&CHK if (($op eq '?:' || $op eq '?' || $op eq ':') && $ctx =~ /VxV/);
3068
3069 if (&{$msg_type}("SPACING",
3070 "spaces required around that '$op' $at\n" . $hereptr)) {
3073 $good = rtrim($fix_elements[$n]) . " " . trim($fix_elements[$n + 1]) . " "; 3071 $good = rtrim($fix_elements[$n]) . " " . trim($fix_elements[$n + 1]) . " ";
3074 if (defined $fix_elements[$n + 2]) { 3072 if (defined $fix_elements[$n + 2]) {
3075 $fix_elements[$n + 2] =~ s/^\s+//; 3073 $fix_elements[$n + 2] =~ s/^\s+//;