scripts/checkpatch.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 1579230ebacc..97078f7629e2 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3063,6 +3063,19 @@ sub process { $last_blank_line = $linenr; } +# Another check for multiple consecutive blank lines where the following +# line is part of the context and is also blank + if ($line =~ /^\+\s*$/ && + defined $rawlines[$linenr] && + $rawlines[$linenr] =~ /^ \s*$/) { + if (CHK("LINE_SPACING", + "Please don't use multiple blank lines\n" . $hereprev) && + $fix) { + fix_delete_line($fixlinenr, $rawline); + } + $last_blank_line = $linenr; + } + # check for missing blank lines after declarations if ($sline =~ /^\+\s+\S/ && #Not at char 1 # actual declarations