From 341a53d1c562c4adbe15e38fdde9b7bc89e4a796 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Tue, 24 May 2022 18:46:45 -0600 Subject: [PATCH] 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 Change-Id: I2f2ee6e0f1b14ae6393ed7e64ba1266aa9debc7d Reviewed-on: https://review.coreboot.org/c/coreboot/+/64656 Tested-by: build bot (Jenkins) Reviewed-by: Elyes Haouas --- util/lint/checkpatch.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl index 1bf9e6556d..0e2988ea9b 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); } }