[Linux-kernel-mentees] [PATCH] checkpatch: improve handling of email comments

Dwaipayan Ray dwaipayanray1 at gmail.com
Sat Oct 31 21:08:34 UTC 2020


> Try this git log grep:
>
> $ git log --format=email -100000 | \
>    grep -P '^(?:[\w\-]+-by:|cc:|CC:|Cc:)' | \
>    grep -v 'stable\@' | \
>    grep -P '\>.+'
>
> This finds any signature/cc line with content after an
> email address that end with a close angle bracket that
> doesn't go to the stable address.
>
> Think about what content after that close angle bracket
> should and shoud not be allowed.
>
> There are a few variants here:
>
> o comments (optional whitespace, followed by '#' or '[' or '(' or c89)
> o misuse of quote (around the whole name and address)
> o Odd commas after '>' likely from defective cut'n'paste use
>
> Then add this to the first grep to avoid the comments as above
>
> $ git log --format=email -100000 | \
>    grep -P '^(?:[\w\-]+-by:|cc:|CC:|Cc:)' | \
>    grep -v 'stable\@' | \
>    grep -P '\>.+' | \
>    grep -vP '\>\s*(?:\#|\(|/\*|\[)'
>
> Shouldn't all these be reported?
> Are they if your patch is applied?
>
> Then look at the addresses that do not have a close angle
> bracket and also have more content after the email address.
>
> $ git log --format=email -100000 | \
>    grep -P '^(?:[\w\-]+-by:|cc:|CC:|Cc:)' | \
>    grep -v 'stable@' | \
>    grep -vP '<[\w\.\@\+\-]+>' | \
>    grep -vP '[\w\.\@\+\-]+$'
>
> What of all of these should be reported?
>
> Happy testing...
>
Hi,
So I ran the tests and there are some interesting results.

The warnings were the same before and after this patch
was applied.

For illegal elements after the closing braces, there were
several errors for which no warnings were reported. These
are:

       6 Cc: Peter Zijlstra <peterz at infradead.org>,
       5 Reviewed-by: "Dietmar Eggemann <dietmar.eggemann at arm.com>"
       1 Suggested-by: Julia Lawall <julia.lawall at lip6.fr>.
       1 Signed-off-by: Vishal Kulkarni <vishal at chelsio.com>"
       1 Signed-off-by: Vishal Kulkarni <vishal at chelsio.com>"
       1 Signed-off-by: Vishal Kulkarni <vishal at chelsio.com>"
       1 Signed-off-by: Veerabhadrarao Badiganti 
<vbadigan at codeaurora.org> Link:
       1 Signed-off-by: Jingle Wu <jingle.wu at emc.com.tw>.
       1 Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at linux.intel.com>,
       1 Reviewed-by: Max Gurtovoy <maxg at mellanox.com 
<mailto:maxg at mellanox.com>>
       1 Reviewed-by: Maulik Shah <mkshah at codeaurora.org> Thanks, Maulik
       1 Reviewed-by: Marc Zyngier <maz at kernel.org> Link: 
https://lore.kernel.org/r/20200826112331.047917603@linutronix.de
       1 Reviewed-by: David Sterba <dsterba at suse.com>i
       1 Reviewed-by: David Sterba <dsterba at suse.com>c
       1 Reviewed-by: David Sterba <dsterba at suse.com>3
       1 Reviewed-by: Christoph Hellwig <hch at lst.de>,
       1 Reviewed-by: Christian König <christian.koenig at amd.com> for both.
       1 Reviewed-by: Christian König <christian.koenig at amd.com>.
       1 Reported-by: Randy Dunlap <rdunlap at infradead.org>>
       1 Reported-by: Qian Cai <cai at redhat.com>>
       1 Reported-by: Qian Cai <cai at lca.pw> writes:
       1 Reported-by: kernel test robot <lkp at intel.com> for missing #include
       1 Reported-by: "kernelci.org bot" <bot at kernelci.org>"
       1 Reported-by: kbuild test robot <lkp at intel.com>]
       1 Reported-by: Bob Sanders <bob.sanders at hpe.com> and the LTP 
testsuite
       1 Cc: Wolfram Sang <wsa at kernel.org>,
       1 Cc: Valdis Kletnieks <valdis.kletnieks at vt.edu>,
       1 Cc: Tvrtko Ursulin <tvrtko.ursulin at linux.intel.com>,
       1 CC: Stephen Rothwell <sfr at canb.auug.org.au>,
       1 Cc: Sia, Jee Heng <jee.heng.sia at intel.com>; 
alsa-devel at alsa-project.org; linux-kernel at vger.kernel.org; 
clang-built-linux at googlegroups.com; Nathan Chancellor 
<natechancellor at gmail.com>
       1 Cc: Robert Sesek <rsesek at google.com>,
       1 CC: Peter Zijlstra <peterz at infradead.org>,
       1 Cc: Omar Sandoval <osandov at fb.com>,
       1 Cc: Michael Neuling <mikey at neuling.org> <mikey at neuling.org>
       1 Cc: Maxime Ripard <mripard at kernel.org>,
       1 Cc: "Martin K. Petersen" <martin.petersen at oracle.com>,
       1 Cc: Mark Scott <mscott at forcepoint.com>,
       1 Cc: Mark Rutland <mark.rutland at arm.com>.
       1 Cc: Mark Rutland <mark.rutland at arm.com>,
       1 Cc: Mark Rutland <mark.rutland at arm.com>,
       1 Cc: Laurent Pinchart <Laurent.pinchart at ideasonboard.com>,
       1 Cc: Kees Cook <keescook at google.com>,
       1 Cc: Jonas Karlman <jonas at kwiboo.se>,
       1 Cc: Jernej Skrabec <jernej.skrabec at siol.net>,
       1 Cc: Jason Wang <jasowang at redhat.com>; Parav Pandit 
<parav at mellanox.com>; virtualization at lists.linux-foundation.org; 
linux-kernel at vger.kernel.org; kernel-janitors at vger.kernel.org
       1 Cc: Jann Horn <jannh at google.com>,
       1 Cc: James Bottomley <james.bottomley at hansenpartnership.com>,
       1 Cc: Icenowy Zheng <icenowy at aosc.io>,
       1 Cc: Dan Murphy <dmurphy at ti.com>A
       1 Cc: Daniel Vetter <daniel at ffwll.ch>,
       1 Cc: Christoph Lameter <cl at linux.com>Cc: Pekka Enberg 
<penberg at kernel.org>
       1 Cc: Christoph Hellwig <hch at lst.de>,
       1 Cc: Christian König <christian.koenig at amd.com>.
       1 CC: "Chang S. Bae" <chang.seok.bae at intel.com>,
       1 Cc: Al Viro <viro at zeniv.linux.org.uk>e
       1 Acked-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>A
       1 Acked-by: Geert Uytterhoeven <geert at linux-m68k.org>A


For cases with no closing '>', following cases were not
reported by checkpatch:

       6 Cc: linux-arm-kernel at lists.infradead.org,
       1 Reviewed-by: Max Gurtovoy <maxg at mellanox.com 
<mailto:maxg at mellanox.com>>
       1 Cc: rostedt at goodmis.org,
       1 Cc: linux-wireless at vger.kernel.org,
       1 Cc: dri-devel at lists.freedesktop.org,

So it's mostly extra commas at the end. But other
illegal characters were also there. Also in one or two
cases, multiple addresses were stacked together.
I think these all deserve to be reported.

Thanks,
Dwaipayan.



More information about the Linux-kernel-mentees mailing list