<div><br></div><div><br><div class="gmail_quote"><div dir="auto">On Mo., 9. Nov. 2020 at 14:10, Aditya Srivastava <<a href="mailto:yashsri421@gmail.com">yashsri421@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Currently checkpatch warns us if there is no 'Signed-off-by' line<br>
for the patch.<br>
<br>
E.g., running checkpatch on commit f68e7927212f ("Revert<br>
"powerpc/book3s32: Reorder _PAGE_XXX flags to simplify TLB handling"")<br>
reports this error:<br>
<br>
ERROR: Missing Signed-off-by: line(s)<br>
<br>
Provide a fix by adding a Signed-off-by line corresponding to the author<br>
of the patch before the start of diff(s)<br>
</blockquote><div dir="auto"><br></div><div dir="auto">Can you please provide an evaluation first?</div><div dir="auto"><br></div><div dir="auto">As far as remember, the fix is often not to add a Signed-off-by: tag but it requires something completely different.</div><div dir="auto"><br></div><div dir="auto">Lukas</div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Suggested-by: Joe Perches <<a href="mailto:joe@perches.com" target="_blank">joe@perches.com</a>><br>
Signed-off-by: Aditya Srivastava <<a href="mailto:yashsri421@gmail.com" target="_blank">yashsri421@gmail.com</a>><br>
---<br>
 scripts/<a href="http://checkpatch.pl" rel="noreferrer" target="_blank">checkpatch.pl</a> | 12 ++++++++++--<br>
 1 file changed, 10 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/scripts/<a href="http://checkpatch.pl" rel="noreferrer" target="_blank">checkpatch.pl</a> b/scripts/<a href="http://checkpatch.pl" rel="noreferrer" target="_blank">checkpatch.pl</a><br>
index cb46288127ac..bc447aa4e5b0 100755<br>
--- a/scripts/<a href="http://checkpatch.pl" rel="noreferrer" target="_blank">checkpatch.pl</a><br>
+++ b/scripts/<a href="http://checkpatch.pl" rel="noreferrer" target="_blank">checkpatch.pl</a><br>
@@ -2404,6 +2404,7 @@ sub process {<br>
<br>
        my $last_blank_line = 0;<br>
        my $last_coalesced_string_linenr = -1;<br>
+       my $diff_linenr = 0;<br>
<br>
        our @report = ();<br>
        our $cnt_lines = 0;<br>
@@ -2602,6 +2603,10 @@ sub process {<br>
                        $realfile =~ s@^([^/]*)/@@ if (!$file);<br>
                        $in_commit_log = 0;<br>
                        $found_file = 1;<br>
+                       # to add missing sign off line before diff(s)<br>
+                       if($diff_linenr == 0) {<br>
+                               $diff_linenr = $fixlinenr;<br>
+                       }<br>
                } elsif ($line =~ /^\+\+\+\s+(\S+)/) {<br>
                        $realfile = $1;<br>
                        $realfile =~ s@^([^/]*)/@@ if (!$file);<br>
@@ -7119,8 +7124,11 @@ sub process {<br>
        }<br>
        if ($is_patch && $has_commit_log && $chk_signoff) {<br>
                if ($signoff == 0) {<br>
-                       ERROR("MISSING_SIGN_OFF",<br>
-                             "Missing Signed-off-by: line(s)\n");<br>
+                       if (ERROR("MISSING_SIGN_OFF",<br>
+                                 "Missing Signed-off-by: line(s)\n") &&<br>
+                           $fix) {<br>
+                               fix_insert_line($diff_linenr, "Signed-off-by: $author\n");<br>
+                       }<br>
                } elsif ($authorsignoff != 1) {<br>
                        # authorsignoff values:<br>
                        # 0 -> missing sign off<br>
-- <br>
2.17.1<br>
<br>
</blockquote></div></div>