Skip to contentSkip to conversation

checkpatch: check GIT_COMMIT_ID for a maximum of 3 consecutive lines

PATCH New Wei Yang 1 participant 1 message Aug 29 Checkpatch

lore
Share & tools
lore

Wei Yang

author
#0 lore raw

PATCH 1/1 checkpatch: check GIT_COMMIT_ID for a maximum of 3 consecutive lines

Following commit log would report git commit description style error.

Commit ee040cbd6e48 ("mm/page_alloc: don't warn about large allocations with __GFP_NOFAIL") remove a warning on allocating large folio with __GFP_NOFAIL, which was placed there by commit 903edea6c53f ("mm: warn about illegal __GFP_NOFAIL usage in a more appropriate location and manner").

Because the second commit description spans 3 lines.

While in commit 4ce9f9704578 ("checkpatch: improve GIT_COMMIT_ID test"), it says it check commit description "for a maximum of 3 consecutive lines".

Add the missing iteration.

---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
index 2b7a42bbdd94..0d1d0986c0d7 100755
@@ -3431,7 +3431,7 @@ sub process {
 
 			my $input = $line;
 			if ($line =~ /(?:\bcommit\s+[0-9a-f]{5,}|\bcommit\s*$)/i) {
-				for (my $n = 0; $n < 2; $n++) {
+				for (my $n = 0; $n < 3; $n++) {
 					if ($input =~ /\bcommit\s+[0-9a-f]{5,}\s*($balanced_parens)/i) {
 						$orig_desc = $1;
 						$has_parens = 1;
Signature · 1 line
2.34.1