diff options
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index bf232642cbb3..32bd31c1345c 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -3689,7 +3689,22 @@ sub process { | |||
3689 | $op eq '*' or $op eq '/' or | 3689 | $op eq '*' or $op eq '/' or |
3690 | $op eq '%') | 3690 | $op eq '%') |
3691 | { | 3691 | { |
3692 | if ($ctx =~ /Wx[^WCE]|[^WCE]xW/) { | 3692 | if ($check) { |
3693 | if (defined $fix_elements[$n + 2] && $ctx !~ /[EW]x[EW]/) { | ||
3694 | if (CHK("SPACING", | ||
3695 | "spaces preferred around that '$op' $at\n" . $hereptr)) { | ||
3696 | $good = rtrim($fix_elements[$n]) . " " . trim($fix_elements[$n + 1]) . " "; | ||
3697 | $fix_elements[$n + 2] =~ s/^\s+//; | ||
3698 | $line_fixed = 1; | ||
3699 | } | ||
3700 | } elsif (!defined $fix_elements[$n + 2] && $ctx !~ /Wx[OE]/) { | ||
3701 | if (CHK("SPACING", | ||
3702 | "space preferred before that '$op' $at\n" . $hereptr)) { | ||
3703 | $good = rtrim($fix_elements[$n]) . " " . trim($fix_elements[$n + 1]); | ||
3704 | $line_fixed = 1; | ||
3705 | } | ||
3706 | } | ||
3707 | } elsif ($ctx =~ /Wx[^WCE]|[^WCE]xW/) { | ||
3693 | if (ERROR("SPACING", | 3708 | if (ERROR("SPACING", |
3694 | "need consistent spacing around '$op' $at\n" . $hereptr)) { | 3709 | "need consistent spacing around '$op' $at\n" . $hereptr)) { |
3695 | $good = rtrim($fix_elements[$n]) . " " . trim($fix_elements[$n + 1]) . " "; | 3710 | $good = rtrim($fix_elements[$n]) . " " . trim($fix_elements[$n + 1]) . " "; |