From 6b4fdaf70159365d4b3507c38ca508bbb5ff334e Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Mon, 17 Dec 2012 16:01:59 -0800 Subject: [PATCH] --- yaml --- r: 346420 b: refs/heads/master c: 0979ae66464bd9793c6701861bccb21f9f118a52 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/scripts/checkpatch.pl | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 85206f32567a..ea5c7493ede0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 481eb486a88c9b068f0168ac4c21291802720933 +refs/heads/master: 0979ae66464bd9793c6701861bccb21f9f118a52 diff --git a/trunk/scripts/checkpatch.pl b/trunk/scripts/checkpatch.pl index 3e9fee60642c..e0a674f471ee 100755 --- a/trunk/scripts/checkpatch.pl +++ b/trunk/scripts/checkpatch.pl @@ -3189,6 +3189,16 @@ sub process { } } +# check for unnecessary blank lines around braces + if (($line =~ /^..*}\s*$/ && $prevline =~ /^.\s*$/)) { + CHK("BRACES", + "Blank lines aren't necessary before a close brace '}'\n" . $hereprev); + } + if (($line =~ /^.\s*$/ && $prevline =~ /^..*{\s*$/)) { + CHK("BRACES", + "Blank lines aren't necessary after an open brace '{'\n" . $hereprev); + } + # no volatiles please my $asm_volatile = qr{\b(__asm__|asm)\s+(__volatile__|volatile)\b}; if ($line =~ /\bvolatile\b/ && $line !~ /$asm_volatile/) {