Xi Chen has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/48560 )
Change subject: checkpatch: fix parsing xxx_for_each_xxx function declaration as list macro style ......................................................................
checkpatch: fix parsing xxx_for_each_xxx function declaration as list macro style
Originally[C, xxx_for_each_xxx style matches list style macro, it also matches function declaration. It will cause alert that '{' should be on the previous line.
For example: static void set_vcore_voltage_for_each_freq(const struct ddr_cali *cali) {
Signed-off-by: Xi Chen xixi.chen@mediatek.com Change-Id: Iacbfefc6c9a3c8b58ba77085890bc4239dac1858 --- M util/lint/checkpatch.pl 1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/48560/1
diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl old mode 100755 new mode 100644 index 1affdb7..9536147 --- a/util/lint/checkpatch.pl +++ b/util/lint/checkpatch.pl @@ -3471,7 +3471,8 @@
# if/while/etc brace do not go on next line, unless defining a do while loop, # or if that brace on the next line is for something else - if ($line =~ /(.*)\b((?:if|while|for|switch|(?:[a-z_]+|)for_each[a-z_]+)\s*(|do\b|else\b)/ && $line !~ /^.\s*#/) { + if ($line =~ /(.*)\b((?:if|while|for|switch)\s*(|do\b|else\b)/ || $line =~ /^(?:[a-z_]+|)for_each[a-z_]+\s*(|do\b|else\b/ + && $line !~ /^.\s*#/) { my $pre_ctx = "$1$2";
my ($level, @ctx) = ctx_statement_level($linenr, $realcnt, 0);