diff options
author | Elyes Haouas <ehaouas@noos.fr> | 2022-07-13 16:29:14 +0200 |
---|---|---|
committer | Martin L Roth <gaumless@tutanota.com> | 2022-07-19 01:45:55 +0000 |
commit | c5ede53ba842dadae7784c43e14d794e96eb54ec (patch) | |
tree | 83dcaadf4327711ba2ff985ca85f675d12c81d75 /util/lint | |
parent | eca8859133f3c5b0114049c4e88ca600cf9433cd (diff) |
lint/checkpatch: Update 'check for assignments on the start of a line'
This reduce the difference with linux v5.19-rc7.
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Change-Id: Ia7d4b0176bad849e79f037f74c3d99ce9eb061c0
Reviewed-on: https://review.coreboot.org/c/coreboot/+/65825
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@tutanota.com>
Diffstat (limited to 'util/lint')
-rwxr-xr-x | util/lint/checkpatch.pl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl index b7b534a552..92a35e6cd7 100755 --- a/util/lint/checkpatch.pl +++ b/util/lint/checkpatch.pl @@ -3364,8 +3364,14 @@ sub process { # check for assignments on the start of a line if ($sline =~ /^\+\s+($Assignment)[^=]/) { - CHK("ASSIGNMENT_CONTINUATIONS", - "Assignment operator '$1' should be on the previous line\n" . $hereprev); + my $operator = $1; + if (CHK("ASSIGNMENT_CONTINUATIONS", + "Assignment operator '$1' should be on the previous line\n" . $hereprev) && + $fix && $prevrawline =~ /^\+/) { + # add assignment operator to the previous line, remove from current line + $fixed[$fixlinenr - 1] .= " $operator"; + $fixed[$fixlinenr] =~ s/\Q$operator\E\s*//; + } } # check for && or || at the start of a line |