summaryrefslogtreecommitdiffstats
path: root/util/lint/checkpatch.pl
diff options
context:
space:
mode:
authorMartin Roth <gaumless@gmail.com>2022-05-24 18:46:45 -0600
committerMartin L Roth <gaumless@tutanota.com>2022-05-28 01:25:48 +0000
commit341a53d1c562c4adbe15e38fdde9b7bc89e4a796 (patch)
treef021ed7798d7c6ddbd4b60478391a9fe68257ca7 /util/lint/checkpatch.pl
parent9e33723d9bfe94318a086d04f34ca4850f54d857 (diff)
downloadcoreboot-341a53d1c562c4adbe15e38fdde9b7bc89e4a796.tar.gz
coreboot-341a53d1c562c4adbe15e38fdde9b7bc89e4a796.tar.bz2
coreboot-341a53d1c562c4adbe15e38fdde9b7bc89e4a796.zip
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>
Diffstat (limited to 'util/lint/checkpatch.pl')
-rwxr-xr-xutil/lint/checkpatch.pl6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl
index 1bf9e6556d8e..0e2988ea9bb7 100755
--- a/util/lint/checkpatch.pl
+++ b/util/lint/checkpatch.pl
@@ -2858,9 +2858,9 @@ sub process {
$line =~ /^Subject: /) {
$line = $line.$rawlines[$linenr];
$line =~ s/^Subject: \[PATCH\] //;
- if (length($line) > 65) {
- WARN("COMMIT_LOG_LONG_LINE",
- "Possible long commit subject (prefer a maximum 65 characters)\n" . $herecurr);
+ if (length($line) - length("Subject: [PATCH] ") > 65) {
+ WARN("COMMIT_LOG_LONG_LINE",
+ "Possible long commit subject (prefer a maximum 65 characters)\n" . $herecurr);
}
}