[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201108134317.25400-1-yashsri421@gmail.com>
Date: Sun, 8 Nov 2020 19:13:17 +0530
From: Aditya Srivastava <yashsri421@...il.com>
To: joe@...ches.com
Cc: yashsri421@...il.com, lukas.bulwahn@...il.com,
dwaipayanray1@...il.com,
linux-kernel-mentees@...ts.linuxfoundation.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] checkpatch: add fix for BAD_SIGN_OFF
Currently, checkpatch warns us if the author of the commit signs-off
as co-developed-by.
E.g. for commit 6e88559470f5 ("Documentation: Add section about
CPU vulnerabilities for Spectre") we get:
WARNING: Co-developed-by: should not be used to attribute nominal
patch author 'Tim Chen <tim.c.chen@...ux.intel.com>'
Co-developed-by: Tim Chen <tim.c.chen@...ux.intel.com>
Provide a simple fix by removing the co-developed-by line from the
commit message
A quick evaluation on v4.13..v5.8 showed that this fix was getting
triggered 6 times.
A quick manual check found out that all fixes were correct in those
cases.
Signed-off-by: Aditya Srivastava <yashsri421@...il.com>
---
scripts/checkpatch.pl | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 58095d9d8f34..1030d4fc2abf 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2827,8 +2827,11 @@ sub process {
# Check Co-developed-by: immediately followed by Signed-off-by: with same name and email
if ($sign_off =~ /^co-developed-by:$/i) {
if ($email eq $author) {
- WARN("BAD_SIGN_OFF",
- "Co-developed-by: should not be used to attribute nominal patch author '$author'\n" . "$here\n" . $rawline);
+ if (WARN("BAD_SIGN_OFF",
+ "Co-developed-by: should not be used to attribute nominal patch author '$author'\n" . "$here\n" . $rawline) &&
+ $fix) {
+ fix_delete_line($fixlinenr, $rawline);
+ }
}
if (!defined $lines[$linenr]) {
WARN("BAD_SIGN_OFF",
--
2.17.1
Powered by blists - more mailing lists