summaryrefslogtreecommitdiff
path: root/util/lint
diff options
context:
space:
mode:
authorElyes Haouas <ehaouas@noos.fr>2022-07-13 16:32:45 +0200
committerMartin L Roth <gaumless@tutanota.com>2022-07-19 01:46:09 +0000
commit86e4a3ae05fbc16198ab63c2cfab0b72e0f8d1df (patch)
tree54dbc039446f703bb73efca58cd64cccc7b423e3 /util/lint
parentc5ede53ba842dadae7784c43e14d794e96eb54ec (diff)
lint/checkpatch: Update 'check for adding lines without a newline'
This reduce the difference with linux v5.19-rc7. Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Change-Id: I1bd68e9a6609a3dfa7dc856f24e4b616714d9990 Reviewed-on: https://review.coreboot.org/c/coreboot/+/65826 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin L Roth <gaumless@tutanota.com>
Diffstat (limited to 'util/lint')
-rwxr-xr-xutil/lint/checkpatch.pl7
1 files changed, 5 insertions, 2 deletions
diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl
index 92a35e6cd7..a8ecff4e71 100755
--- a/util/lint/checkpatch.pl
+++ b/util/lint/checkpatch.pl
@@ -3329,8 +3329,11 @@ sub process {
# check for adding lines without a newline.
if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) {
- WARN("MISSING_EOF_NEWLINE",
- "adding a line without newline at end of file\n" . $herecurr);
+ if (WARN("MISSING_EOF_NEWLINE",
+ "adding a line without newline at end of file\n" . $herecurr) &&
+ $fix) {
+ fix_delete_line($fixlinenr+1, "No newline at end of file");
+ }
}
# check we are in a valid source file C or perl if not then ignore this hunk