diff options
-rwxr-xr-x | scripts/checkpatch.pl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 404e3d6906aa..dc72a9b3172d 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -2698,7 +2698,7 @@ sub process { | |||
2698 | 2698 | ||
2699 | # if/while/etc brace do not go on next line, unless defining a do while loop, | 2699 | # if/while/etc brace do not go on next line, unless defining a do while loop, |
2700 | # or if that brace on the next line is for something else | 2700 | # or if that brace on the next line is for something else |
2701 | if ($line =~ /(.*)\b((?:if|while|for|switch)\s*\(|do\b|else\b)/ && $line !~ /^.\s*\#/) { | 2701 | if ($line =~ /(.*)\b((?:if|while|for|switch|(?:[a-z_]+|)for_each[a-z_]+)\s*\(|do\b|else\b)/ && $line !~ /^.\s*\#/) { |
2702 | my $pre_ctx = "$1$2"; | 2702 | my $pre_ctx = "$1$2"; |
2703 | 2703 | ||
2704 | my ($level, @ctx) = ctx_statement_level($linenr, $realcnt, 0); | 2704 | my ($level, @ctx) = ctx_statement_level($linenr, $realcnt, 0); |
@@ -2744,7 +2744,7 @@ sub process { | |||
2744 | } | 2744 | } |
2745 | 2745 | ||
2746 | # Check relative indent for conditionals and blocks. | 2746 | # Check relative indent for conditionals and blocks. |
2747 | if ($line =~ /\b(?:(?:if|while|for)\s*\(|do\b)/ && $line !~ /^.\s*#/ && $line !~ /\}\s*while\s*/) { | 2747 | if ($line =~ /\b(?:(?:if|while|for|(?:[a-z_]+|)for_each[a-z_]+)\s*\(|do\b)/ && $line !~ /^.\s*#/ && $line !~ /\}\s*while\s*/) { |
2748 | ($stat, $cond, $line_nr_next, $remain_next, $off_next) = | 2748 | ($stat, $cond, $line_nr_next, $remain_next, $off_next) = |
2749 | ctx_statement_block($linenr, $realcnt, 0) | 2749 | ctx_statement_block($linenr, $realcnt, 0) |
2750 | if (!defined $stat); | 2750 | if (!defined $stat); |