From: Pavel Borzenkov Date: Fri, 26 Aug 2011 13:34:37 +0000 (+0400) Subject: checkpatch: fix braces {} handling X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=01c4330b58909612ac202573da6e1a872b8bb0ad;p=qemu.git checkpatch: fix braces {} handling checkpatch.pl doesn't report warning for if/else statements with missing 'else' braces: if (something) { foo; } else bar; The patch has been tested using the last 100 commits. Signed-off-by: Pavel Borzenkov Signed-off-by: Blue Swirl --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 3498425fff..0eba357cc2 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2532,7 +2532,7 @@ sub process { $allowed = 1; } } - if (!$seen) { + if ($seen != ($#chunks + 1)) { WARN("braces {} are necessary for all arms of this statement\n" . $herectx); } }