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>
This commit is contained in:
Elyes Haouas 2022-07-13 16:32:45 +02:00 committed by Martin L Roth
parent c5ede53ba8
commit 86e4a3ae05
1 changed files with 5 additions and 2 deletions

View File

@ -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