util/lint: Subtract the patch format string from subject length

Checkpatch was looking for a 65 character length, but format-patch adds
the text "Subject: [PATCH] " before the actual subject.  Checkpatch
needs to account for that when looking at the line length.

Lines 2863 & 2864 have their indentation fixed as well.

Signed-off-by: Martin Roth <gaumless@gmail.com>
Change-Id: I2f2ee6e0f1b14ae6393ed7e64ba1266aa9debc7d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64656
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
This commit is contained in:
Martin Roth 2022-05-24 18:46:45 -06:00 committed by Martin L Roth
parent 9e33723d9b
commit 341a53d1c5
1 changed files with 3 additions and 3 deletions

View File

@ -2858,9 +2858,9 @@ sub process {
$line =~ /^Subject: /) { $line =~ /^Subject: /) {
$line = $line.$rawlines[$linenr]; $line = $line.$rawlines[$linenr];
$line =~ s/^Subject: \[PATCH\] //; $line =~ s/^Subject: \[PATCH\] //;
if (length($line) > 65) { if (length($line) - length("Subject: [PATCH] ") > 65) {
WARN("COMMIT_LOG_LONG_LINE", WARN("COMMIT_LOG_LONG_LINE",
"Possible long commit subject (prefer a maximum 65 characters)\n" . $herecurr); "Possible long commit subject (prefer a maximum 65 characters)\n" . $herecurr);
} }
} }