From: Andy Whitcroft Date: Fri, 2 Dec 2011 03:12:45 +0000 (+1100) Subject: checkpatch: complex macro should allow the empty do while loop X-Git-Tag: next-20111206~1^2~94 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d138f87a940176986a50b7ef0908b0b54392e7a2;p=karo-tx-linux.git checkpatch: complex macro should allow the empty do while loop 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 Cc: Joe Perches Signed-off-by: Andrew Morton --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index afc656d00589..ca6d0fb229f2 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -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 {...