aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 913d6bdfdda3..ca05ba217f5f 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3016,7 +3016,8 @@ sub process {
3016 $herectx .= raw_line($linenr, $n) . "\n"; 3016 $herectx .= raw_line($linenr, $n) . "\n";
3017 } 3017 }
3018 3018
3019 if (($stmts =~ tr/;/;/) == 1) { 3019 if (($stmts =~ tr/;/;/) == 1 &&
3020 $stmts !~ /^\s*(if|while|for|switch)\b/) {
3020 WARN("SINGLE_STATEMENT_DO_WHILE_MACRO", 3021 WARN("SINGLE_STATEMENT_DO_WHILE_MACRO",
3021 "Single statement macros should not use a do {} while (0) loop\n" . "$herectx"); 3022 "Single statement macros should not use a do {} while (0) loop\n" . "$herectx");
3022 } 3023 }