From 01c4330b58909612ac202573da6e1a872b8bb0ad Mon Sep 17 00:00:00 2001 From: Pavel Borzenkov Date: Fri, 26 Aug 2011 17:34:37 +0400 Subject: [PATCH] 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 --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 3498425..0eba357 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); } } -- 2.7.4