[Linux-kernel-mentees] Linux kernel checkpatch.pl mentorship

Lukas Bulwahn lukas.bulwahn at gmail.com
Thu Sep 17 14:18:50 UTC 2020



On Thu, 17 Sep 2020, Dwaipayan Ray wrote:

> > So you see in all these cases non ascii characters are present. I looked
> > into checkpatch.pl .
> >
> > line 2662:
> >         if (decode("MIME-Header", $line) =~ /^From:\s*(.*)/) {
> >            $author = $1;
> >             $author = encode("utf8", $author) if ($line =~ /=\?utf-8\?/i);
> >             $author =~ s/"//g;
> >             $author = reformat_email($author);
> >         }
> >
> > When i looked into $line, it gave below:
> > From: =?UTF-8?q?=E5=91=A8=E7=90=B0=E6=9D=B0=20=28Zhou=20Yanjie
> > =29?=
> > <zhouyanjie at wanyeetech.com>
> >
> > And at the end of this block, $author was equal to ''.
> > There seems to be a parsing problem there.
> 
> Also I looked into this output more, and I looked into the git
> history. For the FROM:
> parsing part, the author wrote this:
> 
> "Non-ASCII quoted printable encoding in From: headers and (lack of) double
> quotes are handled.  Split From: headers are not fully handled: only the
> the first part is compared."
> 
> So the problem instead seems to be the Split From: headers. In all the
> cases that I
> mentioned, due to formatting issues or something, the email address was
> pushed off into the next line, due to which parsing fails.
> 
> A solution would be to write logic for handling these Split From:
> headers, which the
> author left off.
>

Good investigation. Can you please share the commit of the commit message 
you refer to in the future?

I found it, commit cd2614967d8b ("checkpatch: warn if missing author 
Signed-off-by"), but to convince the maintainers and authors that you did 
your homework properly, it is good to refer to the commits you looked at.

The kernel documentation tells you how to refer to commits.

Lukas


More information about the Linux-kernel-mentees mailing list