Skip to contentSkip to conversation

checkpatch: Tolerate upstream commit references

PATCH Superseded Petr Machata 1 participant 2 messages Dec 17, 2024 – Jan 7, 2025 Checkpatch

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkpatch: Tolerate upstream commit references

Two forms of upstream commit references are used (and documented) for stable kernels:

- [ Upstream commit <sha1> ]
- commit <sha1> upstream.

These are useful apart from stable kernel trees to other downstream maintainers that wish to keep track of what came from where. But checkpatch gives citations on patches annotated this way.

Extend checkpatch to tolerate the documented upstream references. This reduces noise for downstream maintainers.

---
 scripts/checkpatch.pl | 2 ++
 1 file changed, 2 insertions(+)
scripts/checkpatch.pl +2 -0
index 9eed3683ad76..a6c81b38e413 100755
@@ -3340,6 +3340,8 @@ sub process {
 		if ($perl_version_ok &&
 		    $in_commit_log && !$commit_log_possible_stack_dump &&
 		    $line !~ /^\s*(?:Link|Patchwork|http|https|BugLink|base-commit):/i &&
+		    $line !~ /^\s*\[ Upstream commit [0-9a-f]{40} ]/ &&
+		    $line !~ /^\s*commit [0-9a-f]{40}\s*upstream\./ &&
 		    $line !~ /^This reverts commit [0-9a-f]{7,40}/ &&
 		    (($line =~ /\bcommit\s+[0-9a-f]{5,}\b/i ||
 		      ($line =~ /\bcommit\s*$/i && defined($rawlines[$linenr]) && $rawlines[$linenr] =~ /^\s*[0-9a-f]{5,}\b/i)) ||
Signature · 1 line
2.47.0
#1 lore raw
Quoted 10 lines · Petr Machata

Two forms of upstream commit references are used (and documented) for stable kernels:

- [ Upstream commit <sha1> ]
- commit <sha1> upstream.

These are useful apart from stable kernel trees to other downstream maintainers that wish to keep track of what came from where. But checkpatch gives citations on patches annotated this way.

Quoted 5 lines

Extend checkpatch to tolerate the documented upstream references. This reduces noise for downstream maintainers.

Hello y'all all and happy 2025!

I sent this towards the end of the year, and understandably people were busy around New Year's. This is to try and make sure the patch doesn't get lost in last year's mailing, and ask for a bit of an attention from maintainers.

Thanks!

Quoted 17 lines
---
 scripts/checkpatch.pl | 2 ++
 1 file changed, 2 insertions(+)
scripts/checkpatch.pl +2 -0
index 9eed3683ad76..a6c81b38e413 100755
@@ -3340,6 +3340,8 @@ sub process {
 		if ($perl_version_ok &&
 		    $in_commit_log && !$commit_log_possible_stack_dump &&
 		    $line !~ /^\s*(?:Link|Patchwork|http|https|BugLink|base-commit):/i &&
+		    $line !~ /^\s*\[ Upstream commit [0-9a-f]{40} ]/ &&
+		    $line !~ /^\s*commit [0-9a-f]{40}\s*upstream\./ &&
 		    $line !~ /^This reverts commit [0-9a-f]{7,40}/ &&
 		    (($line =~ /\bcommit\s+[0-9a-f]{5,}\b/i ||
 		      ($line =~ /\bcommit\s*$/i && defined($rawlines[$linenr]) && $rawlines[$linenr] =~ /^\s*[0-9a-f]{5,}\b/i)) ||