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

Lukas Bulwahn lukas.bulwahn at gmail.com
Mon Sep 14 18:32:05 UTC 2020

On Mon, 14 Sep 2020, Dwaipayan Ray wrote:

> > > The third candidate is related to the warning:
> > >
> > > WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author ...
> > >
> > > I found several such commits in which the author had used different mail addresses in the
> > > signed-off -by section, due to which this warning is generated.
> > >
> > > An example is Commit dc5bdb68b5b3 .
> > > Git log show:
> > > Author: Daniel Vetter <daniel.vetter at ffwll.ch>
> > > ....,.
> > > Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> > >
> > > This is infact a common scenario. I easily found another commit 207324a321a8.
> > > Git log shows:
> > > Author: Minas Harutyunyan <Minas.Harutyunyan at synopsys.com>
> > > ...
> > > Signed-off-by: Minas Harutyunyan <hminas at synopsys.com>
> > >
> > > This warning could be avoided or at least handled better.
> > >
> > >
> > > I would like to know if any of them can be worked on.
> > >
> >
> > This last one might be good to look into.
> >
> > But what is your specific solution you have in mind?
> >
> > There is a file .mailmap in the repository that allows some kind of
> > mapping. Maybe that is helpful.
> >
> > I suggest that you describe your proposed change in a clear way.
> > Then, we can discuss if that change is reasonable or not.
> I checked the .mailmap file and it doesn't have all the email addresses. So it might not
> be effective.
> checkpatch.pl seems to compare only the email addresses to determine whether the author
> has signed off.
> checkpatch, line 2673:
> if ($author ne '') {
>                 if (same_email_addresses($1, $author)) {
>                     $authorsignoff = 1;
>                 }
>             }
> This causes numerous false positives if the author uses a different mail, which seems to be quite frequent.

But using different mail addresses should be complained about; unless we 
really have a record that these two email addresses point to the same 
> A possible solution would be to compare the names, i.e. $1 and $author, and keep its result stored
> in some variable authorsignoff_byname. If the author's mail is not found, but his name matches, 
> there can be a better warning message on the lines of:
> "Possible missing signed-off-by line by nominal author. Author's email $email does not match signed off email.
> $email2"
> Or, if the warning message cannot be changed, there could be verbose information regarding the mismatch of email.
> Is this feasible? 

(Hmm, your email client is broken... lines so long...)

Sure, that is possible if the check is reasonable. But I do not understand 
what we are doing here.

It should complain when the author email and sign-off-by email does not 
match, right?

First explain:

- which situations does checkpatch.pl currently complain about?

- for which situation do you want to have more refined checks?

- why does that actually improve checkpatch.pl?

Checkpatch.pl should complain when developers do something wrong.

To really understand what is wrong behavior and what is not, you probably 
need to create some statistics on who authors and signs off with which 
names and email addresses.

Maybe we can collect all the previous instances where we know that 
frequent developers, e.g., with more >100 commits, use multiple email 
addresses interchangeably. If we add that list to the repository and
let others know how to maintain it, checkpatch.pl can make use of that.

With that extended check, we can warn newbies that just have a broken git 
and sign-off setup and still reduce the false positives for the 
experienced developers that might just have good reasons to have the 
setup they have, i.e., they have this setup for many years and want to 
keep it that way. 

You can try to work that through or look for another case of potential 
checkpatch.pl improvement in your evaluation data.


More information about the Linux-kernel-mentees mailing list