diff options
author | Elyes Haouas <ehaouas@noos.fr> | 2022-07-13 16:36:25 +0200 |
---|---|---|
committer | Martin L Roth <gaumless@tutanota.com> | 2022-07-19 01:46:40 +0000 |
commit | a59a87ca17ff6fd2933c26043e78ac9e4fb3fa5d (patch) | |
tree | 4359b488d341ae3a7c6232125d91bf79605ca09a | |
parent | d92fcf448f3e50f605b2c4eda13772680f47516f (diff) |
lint/checkpatch: Update 'check indentation of a line with a break'
This reduce the difference with linux v5.19-rc7.
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Change-Id: I79170a45cd8184ebc816b4f16656a3cfdc257f60
Reviewed-on: https://review.coreboot.org/c/coreboot/+/65828
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@tutanota.com>
-rwxr-xr-x | util/lint/checkpatch.pl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl index f41f6ab244..577bdfa1a2 100755 --- a/util/lint/checkpatch.pl +++ b/util/lint/checkpatch.pl @@ -3636,9 +3636,12 @@ sub process { # and is indented the same # of tabs if ($sline =~ /^\+([\t]+)break\s*;\s*$/) { my $tabs = $1; - if ($prevline =~ /^\+$tabs(?:goto|return|break)\b/) { - WARN("UNNECESSARY_BREAK", - "break is not useful after a $1\n" . $hereprev); + if ($prevline =~ /^\+$tabs(goto|return|break)\b/) { + if (WARN("UNNECESSARY_BREAK", + "break is not useful after a $1\n" . $hereprev) && + $fix) { + fix_delete_line($fixlinenr, $rawline); + } } } |