All the various for_each loop macros were not tested for trailing brace on the following lines and for bad indentation. Add them.
Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all
Unified · Split
| @@ -2698,7 +2698,7 @@ sub process { · 2697 unmodified lines | ||
| 2698 | 2698 | |
| 2699 | 2699 | # if/while/etc brace do not go on next line, unless defining a do while loop, |
| 2700 | 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 | 2702 | my $pre_ctx = "$1$2"; |
| 2703 | 2703 | |
| 2704 | 2704 | my ($level, @ctx) = ctx_statement_level($linenr, $realcnt, 0); |
| @@ -2744,7 +2744,7 @@ sub process { · 39 unmodified lines | ||
| 2744 | 2744 | } |
| 2745 | 2745 | |
| 2746 | 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 | 2748 | ($stat, $cond, $line_nr_next, $remain_next, $off_next) = |
| 2749 | 2749 | ctx_statement_block($linenr, $realcnt, 0) |
| 2750 | 2750 | if (!defined $stat); |