[Linux-kernel-mentees] [PATCH v2] checkpatch: extend author Signed-off-by check for split From: header

Dwaipayan Ray dwaipayanray1 at gmail.com
Sat Sep 19 20:47:21 UTC 2020


Checkpatch did not handle cases where the author From: header
was split into multiple lines. The author identity could not
be resolved and checkpatch generated a false NO_AUTHOR_SIGN_OFF
warning.

Support split From: headers in AUTHOR_SIGN_OFF check by correctly
parsing the entire From: header in such cases.

Signed-off-by: Dwaipayan Ray <dwaipayanray1 at gmail.com>
---
 scripts/checkpatch.pl | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 504d2e431c60..8ee61ec346b3 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2661,6 +2661,10 @@ sub process {
 # Check the patch for a From:
 		if (decode("MIME-Header", $line) =~ /^From:\s*(.*)/) {
 			$author = $1;
+			my $curline = $linenr-1;
+			while(defined($rawlines[++$curline]) && ($rawlines[$curline] =~ /^\s+(.*)/)) {
+				$author.= $1;
+			}
 			$author = encode("utf8", $author) if ($line =~ /=\?utf-8\?/i);
 			$author =~ s/"//g;
 			$author = reformat_email($author);
-- 
2.27.0



More information about the Linux-kernel-mentees mailing list