linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] checkpatch: mute SOB warning in case SOB exists but without From header
@ 2019-04-21  3:25 Dave Young
  0 siblings, 0 replies; only message in thread
From: Dave Young @ 2019-04-21  3:25 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches, linux-kernel

checkpatch.pl report below warning but the SOB line is correct:
$ ./scripts/checkpatch.pl patches/test.patch
WARNING: Missing Signed-off-by: line by nominal patch author ''

Actually checkpatch.pl assumes every patch includes "From:" line,
this is true for a git formated patch, some saved mail format patch.

But the warning is boring for people who do not use git formated patch.
Change the script only print warning in case "From:" line exists.

Signed-off-by: Dave Young <dyoung@redhat.com>
---
 scripts/checkpatch.pl |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- linux-x86.orig/scripts/checkpatch.pl
+++ linux-x86/scripts/checkpatch.pl
@@ -2283,7 +2283,7 @@ sub process {
 	our $clean = 1;
 	my $signoff = 0;
 	my $author = '';
-	my $authorsignoff = 0;
+	my $authorsignoff = -1;
 	my $is_patch = 0;
 	my $is_binding_patch = -1;
 	my $in_header_lines = $file ? 0 : 1;
@@ -2609,6 +2609,8 @@ sub process {
 				$l =~ s/"//g;
 				if ($l =~ /^\s*signed-off-by:\s*\Q$author\E/i) {
 				    $authorsignoff = 1;
+				} else {
+				    $authorsignoff = 0;
 				}
 			}
 		}
@@ -6649,7 +6651,7 @@ sub process {
 		if ($signoff == 0) {
 			ERROR("MISSING_SIGN_OFF",
 			      "Missing Signed-off-by: line(s)\n");
-		} elsif (!$authorsignoff) {
+		} elsif ($authorsignoff == 0) {
 			WARN("NO_AUTHOR_SIGN_OFF",
 			     "Missing Signed-off-by: line by nominal patch author '$author'\n");
 		}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-04-21  3:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-21  3:25 [PATCH] checkpatch: mute SOB warning in case SOB exists but without From header Dave Young

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).