checkpatch: clean up structure definition macro handline
authorAndy Whitcroft <apw@canonical.com>
Tue, 26 Oct 2010 21:23:18 +0000 (14:23 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Oct 2010 23:52:20 +0000 (16:52 -0700)
Handle definitions such as the following correctly, it is not
a complex statement:

    #define PREALLOC(NAME, START, END, FLAGS) {     \
    .name = (NAME),                 \
    .start = (START),               \
    .end = (END),                   \
    .flags = (FLAGS)                \
    },

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/checkpatch.pl

index 53b2eaecba0c9b55b5ed37177a4b1ab347086ca0..d5361e49abadc8012d3db3f1f1d7075639c5046f 100755 (executable)
@@ -2476,8 +2476,8 @@ sub process {
                                \.$Ident\s*=\s*|
                                ^\"|\"$
                        }x;
-                       #print "REST<$rest> dstat<$dstat>\n";
-                       if ($rest ne '') {
+                       #print "REST<$rest> dstat<$dstat> ctx<$ctx>\n";
+                       if ($rest ne '' && $rest ne ',') {
                                if ($rest !~ /while\s*\(/ &&
                                    $dstat !~ /$exceptions/)
                                {