]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
checkpatch: complex macro should allow the empty do while loop
authorAndy Whitcroft <apw@canonical.com>
Thu, 8 Dec 2011 04:42:24 +0000 (15:42 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 13 Dec 2011 06:43:20 +0000 (17:43 +1100)
It is common to stub out a function as below, this is triggering a complex
macro format incorrectly.  Sort this out:

    #define cma_early_regions_reserve(reserve)   do { } while (0)

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
scripts/checkpatch.pl

index afc656d0058990555a17a38930e07fefd0c44d1e..ca6d0fb229f2c2fa89acb096fadb0f4d572b581a 100755 (executable)
@@ -2838,7 +2838,7 @@ sub process {
                            $dstat !~ /^(?:$Ident|-?$Constant)$/ &&                     # 10 // foo()
                            $dstat !~ /$exceptions/ &&
                            $dstat !~ /^\.$Ident\s*=/ &&                                # .foo =
-                           $dstat !~ /^do\s*$Constant\s*while\s*$Constant;$/ &&        # do {...} while (...);
+                           $dstat !~ /^do\s*$Constant\s*while\s*$Constant;?$/ &&       # do {...} while (...); // do {...} while (...)
                            $dstat !~ /^for\s*$Constant$/ &&                            # for (...)
                            $dstat !~ /^for\s*$Constant\s+(?:$Ident|-?$Constant)$/ &&   # for (...) bar()
                            $dstat !~ /^do\s*{/ &&                                      # do {...