lkml.org 
[lkml]   [2020]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] checkpatch: Do not check git commit description style when backport the upstream commit
Date
When backport the upstream commit to the internal LTS kernel version,
we usually use the following description [1] [2]:

[ Upstream commit cc6528bc9a0c901c83b8220a2e2617f3354d6dd9 ]
or
commit c51f8f88d705e06bd696d7510aff22b33eb8e638 upstream.

We use checkpatch.pl before auto build and there exists auto build
failure due to the following checkpatch error:

ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit cc6528bc9a0c ("r8169: fix potential skb double free in an error path")'
#6:
[ Upstream commit cc6528bc9a0c901c83b8220a2e2617f3354d6dd9 ]
or
ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit c51f8f88d705 ("random32: make prandom_u32() output unpredictable")'
#6:
commit c51f8f88d705e06bd696d7510aff22b33eb8e638 upstream.

We can use "--ignore GIT_COMMIT_ID" to avoid this checkpatch
error, but I think it is better to modify the check rule of
checkpatch. When there exists "Upstream" or "upstream" in the
commit line, it seems no need to do more check.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-4.19.y&id=bc571404829755e4a9504cc5fbc636fea80b2d83
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-4.19.y&id=81d7c56d6fab5ccbf522c47a655cd427808679f2

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
scripts/checkpatch.pl | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index fab38b4..f5bbfdd 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2889,7 +2889,8 @@ sub process {
($line =~ /\bcommit\s+[0-9a-f]{5,}\b/i ||
($line =~ /(?:\s|^)[0-9a-f]{12,40}(?:[\s"'\(\[]|$)/i &&
$line !~ /[\<\[][0-9a-f]{12,40}[\>\]]/i &&
- $line !~ /\bfixes:\s*[0-9a-f]{12,40}/i))) {
+ $line !~ /\bfixes:\s*[0-9a-f]{12,40}/i)) &&
+ $line !~ /^\s*Upstream|upstream/i) {
my $init_char = "c";
my $orig_commit = "";
my $short = 1;
--
2.1.0
\
 
 \ /
  Last update: 2020-11-25 04:31    [W:0.032 / U:1.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site