]> git.proxmox.com Git - qemu.git/commitdiff
checkpatch: fix braces {} handling
authorPavel Borzenkov <pavel.borzenkov@gmail.com>
Fri, 26 Aug 2011 13:34:37 +0000 (17:34 +0400)
committerBlue Swirl <blauwirbel@gmail.com>
Sat, 27 Aug 2011 15:44:16 +0000 (15:44 +0000)
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 <pavel.borzenkov@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
scripts/checkpatch.pl

index 3498425fff68fe48292df2115177deb97e3bbb3d..0eba357cc2105be70a7738601be552801bc5b5bd 100755 (executable)
@@ -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);
                                }
                        }