From: Andy Whitcroft Date: Fri, 16 Dec 2011 04:50:19 +0000 (+1100) Subject: checkpatch: complex macro should allow the empty do while loop X-Git-Tag: next-20111221~2^2~97 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=77daac1e4773aa8808a1f694cbae0f318fa559af;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 {...