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>
This commit is contained in:
Elyes Haouas 2022-07-13 16:36:25 +02:00 committed by Martin L Roth
parent d92fcf448f
commit a59a87ca17
1 changed files with 6 additions and 3 deletions

View File

@ -3636,9 +3636,12 @@ sub process {
# and is indented the same # of tabs # and is indented the same # of tabs
if ($sline =~ /^\+([\t]+)break\s*;\s*$/) { if ($sline =~ /^\+([\t]+)break\s*;\s*$/) {
my $tabs = $1; my $tabs = $1;
if ($prevline =~ /^\+$tabs(?:goto|return|break)\b/) { if ($prevline =~ /^\+$tabs(goto|return|break)\b/) {
WARN("UNNECESSARY_BREAK", if (WARN("UNNECESSARY_BREAK",
"break is not useful after a $1\n" . $hereprev); "break is not useful after a $1\n" . $hereprev) &&
$fix) {
fix_delete_line($fixlinenr, $rawline);
}
} }
} }