diff options
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 6705576198a6..059c032d8882 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -4461,12 +4461,18 @@ sub process { | |||
4461 | 4461 | ||
4462 | # check for unnecessary blank lines around braces | 4462 | # check for unnecessary blank lines around braces |
4463 | if (($line =~ /^.\s*}\s*$/ && $prevrawline =~ /^.\s*$/)) { | 4463 | if (($line =~ /^.\s*}\s*$/ && $prevrawline =~ /^.\s*$/)) { |
4464 | CHK("BRACES", | 4464 | if (CHK("BRACES", |
4465 | "Blank lines aren't necessary before a close brace '}'\n" . $hereprev); | 4465 | "Blank lines aren't necessary before a close brace '}'\n" . $hereprev) && |
4466 | $fix && $prevrawline =~ /^\+/) { | ||
4467 | fix_delete_line($fixlinenr - 1, $prevrawline); | ||
4468 | } | ||
4466 | } | 4469 | } |
4467 | if (($rawline =~ /^.\s*$/ && $prevline =~ /^..*{\s*$/)) { | 4470 | if (($rawline =~ /^.\s*$/ && $prevline =~ /^..*{\s*$/)) { |
4468 | CHK("BRACES", | 4471 | if (CHK("BRACES", |
4469 | "Blank lines aren't necessary after an open brace '{'\n" . $hereprev); | 4472 | "Blank lines aren't necessary after an open brace '{'\n" . $hereprev) && |
4473 | $fix) { | ||
4474 | fix_delete_line($fixlinenr, $rawline); | ||
4475 | } | ||
4470 | } | 4476 | } |
4471 | 4477 | ||
4472 | # no volatiles please | 4478 | # no volatiles please |