[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190508122721.7513-2-borneo.antonio@gmail.com>
Date: Wed, 8 May 2019 14:27:19 +0200
From: Antonio Borneo <borneo.antonio@...il.com>
To: Joe Perches <joe@...ches.com>, Andy Whitcroft <apw@...onical.com>
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH 2/4] checkpatch: add --fix for warning LINE_CONTINUATIONS
The warning LINE_CONTINUATIONS does not offer a --fix.
Add the trivial --fix.
In case of consecutive lines with the same issue, this will
fix only the first line.
Signed-off-by: Antonio Borneo <borneo.antonio@...il.com>
---
scripts/checkpatch.pl | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index f40d4bb2fbb9..9a247183b65c 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5207,8 +5207,11 @@ sub process {
$line !~ /^\+\s*\#.*\\$/ && # preprocessor
$line !~ /^\+.*\b(__asm__|asm)\b.*\\$/ && # asm
$line =~ /^\+.*\\$/) {
- WARN("LINE_CONTINUATIONS",
- "Avoid unnecessary line continuations\n" . $herecurr);
+ if (WARN("LINE_CONTINUATIONS",
+ "Avoid unnecessary line continuations\n" . $herecurr) &&
+ $fix) {
+ $fixed[$fixlinenr] =~ s/\s*\\$//;
+ }
}
}
--
2.21.0
Powered by blists - more mailing lists