summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorElyes Haouas <ehaouas@noos.fr>2022-07-13 16:36:25 +0200
committerMartin L Roth <gaumless@tutanota.com>2022-07-19 01:46:40 +0000
commita59a87ca17ff6fd2933c26043e78ac9e4fb3fa5d (patch)
tree4359b488d341ae3a7c6232125d91bf79605ca09a /util
parentd92fcf448f3e50f605b2c4eda13772680f47516f (diff)
downloadcoreboot-a59a87ca17ff6fd2933c26043e78ac9e4fb3fa5d.tar.gz
coreboot-a59a87ca17ff6fd2933c26043e78ac9e4fb3fa5d.tar.bz2
coreboot-a59a87ca17ff6fd2933c26043e78ac9e4fb3fa5d.zip
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>
Diffstat (limited to 'util')
-rwxr-xr-xutil/lint/checkpatch.pl9
1 files changed, 6 insertions, 3 deletions
diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl
index f41f6ab2446f..577bdfa1a23b 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);
+ }
}
}