From a69cacfcc9b93730bdaeed2862fc9dfd4d0b2287 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Tue, 21 Aug 2012 16:15:53 -0700 Subject: [PATCH] --- yaml --- r: 322076 b: refs/heads/master c: ac8e97f8a742828daa1d9de37f6e635888f8d71e h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/scripts/checkpatch.pl | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index e0de064c552d..b0f84a171645 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: eb48c071464757414538c68a6033c8f8c15196f8 +refs/heads/master: ac8e97f8a742828daa1d9de37f6e635888f8d71e diff --git a/trunk/scripts/checkpatch.pl b/trunk/scripts/checkpatch.pl index 913d6bdfdda3..ca05ba217f5f 100755 --- a/trunk/scripts/checkpatch.pl +++ b/trunk/scripts/checkpatch.pl @@ -3016,7 +3016,8 @@ sub process { $herectx .= raw_line($linenr, $n) . "\n"; } - if (($stmts =~ tr/;/;/) == 1) { + if (($stmts =~ tr/;/;/) == 1 && + $stmts !~ /^\s*(if|while|for|switch)\b/) { WARN("SINGLE_STATEMENT_DO_WHILE_MACRO", "Single statement macros should not use a do {} while (0) loop\n" . "$herectx"); }