checkpatch: add fix for BAD_SIGN_OFF
PATCH 1/1 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 <[email protected]>'
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.
--- scripts/checkpatch.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
scripts/checkpatch.pl +5 -2
@@ -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",
Signature · 6 lines
2.17.1 _______________________________________________ Linux-kernel-mentees mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Joe Perches
maintainerQuoted 2 lines · Aditya Srivastava
Currently, checkpatch warns us if the author of the commit signs-off as co-developed-by.
[]
Quoted 2 lines
A quick manual check found out that all fixes were correct in those cases.
[]
scripts/checkpatch.pl
Quoted 1 line
scripts/checkpatch.pl +0
-0
[]
Quoted 4 lines
scripts/checkpatch.pl +0
-0@@ -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) {
scripts/checkpatch.pl sub process { · line 2837
Quoted 10 lines
scripts/checkpatch.pl +5
-2- 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",
Looks OK to me.
Another option might be to add a Signed-off-by: line derived from any "From:" line when:
if ($is_patch && $has_commit_log && $chk_signoff) {
if ($signoff == 0) {
ERROR("MISSING_SIGN_OFF",
"Missing Signed-off-by: line(s)\n");etc...
Quoted 29 lines · Joe Perches
Quoted 2 lines · Aditya Srivastava
Currently, checkpatch warns us if the author of the commit signs-off as co-developed-by.
[]
Quoted 2 lines
A quick manual check found out that all fixes were correct in those cases.
[]
scripts/checkpatch.pl
Quoted 1 line
scripts/checkpatch.pl +0
-0[]
Quoted 4 lines
scripts/checkpatch.pl +0
-0@@ -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) {scripts/checkpatch.pl sub process { · line 2837
Quoted 10 lines
scripts/checkpatch.pl +5
-2- 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",Looks OK to me.
Another option might be to add a Signed-off-by: line derived from any "From:" line when:
Quoted 7 lines
if ($is_patch && $has_commit_log && $chk_signoff) { if ($signoff == 0) { ERROR("MISSING_SIGN_OFF", "Missing Signed-off-by: line(s)\n");etc...
Yes, I just noticed. Thanks for the suggestion. Will do.
Thanks
Aditya
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Quoted 29 lines · Joe Perches
Quoted 2 lines · Aditya Srivastava
Currently, checkpatch warns us if the author of the commit signs-off as co-developed-by.
[]
Quoted 2 lines
A quick manual check found out that all fixes were correct in those cases.
[]
scripts/checkpatch.pl
Quoted 1 line
scripts/checkpatch.pl +0
-0[]
Quoted 4 lines
scripts/checkpatch.pl +0
-0@@ -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) {scripts/checkpatch.pl sub process { · line 2837
Quoted 10 lines
scripts/checkpatch.pl +5
-2- 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",Looks OK to me.
Another option might be to add a Signed-off-by: line derived from any "From:" line when:
Quoted 7 lines
if ($is_patch && $has_commit_log && $chk_signoff) { if ($signoff == 0) { ERROR("MISSING_SIGN_OFF", "Missing Signed-off-by: line(s)\n");etc...
Hi Joe
You probably forgot to Ack this patch.
Thanks
Aditya
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees