Re: [PATCH] scripts/checkpatch.pl - fix *_NOTIFIER_HEAD handling

From: Valdis KlÄtnieks
Date: Thu Aug 08 2019 - 02:08:35 EST


On Wed, 07 Aug 2019 22:50:47 -0700, Joe Perches said:
> On Wed, 2019-08-07 at 21:36 -0400, Valdis KlÄ?tnieks wrote:

> > ^.DEFINE_$Ident\(\Q$name\E\)|
> > ^.DECLARE_$Ident\(\Q$name\E\)|
> > ^.LIST_HEAD\(\Q$name\E\)|
> > - ^.{$Ident}_NOTIFIER_HEAD\(\Q$name\E\)|
> > + ^.${Ident}_NOTIFIER_HEAD\(\Q$name\E\)|
>
> Perhaps also better to convert all the '\Q$name\E' to '\s*\Q$name\E\s*'

Yes, but that would need to be a separate patch. The question would be if we
consider 'DEFINE_foo( barbaz )' and similar with whitespace to be desirable
style or not.

[/usr/src/linux-next] grep '\\Q$name\\E' scripts/checkpatch.pl
^.DEFINE_$Ident\(\Q$name\E\)|
^.DECLARE_$Ident\(\Q$name\E\)|
^.LIST_HEAD\(\Q$name\E\)|
^.${Ident}_NOTIFIER_HEAD\(\Q$name\E\)|
^.(?:$Storage\s+)?$Type\s*\(\s*\*\s*\Q$name\E\s*\)\s*\(|
\b\Q$name\E(?:\s+$Attribute)*\s*(?:;|=|\[|\()

We already have the \s* in one place. Somebody else can decide if it should
be in the other 5 places or not. :)

Attachment: pgp1fN5d_71qm.pgp
Description: PGP signature