From: Joe Perches <joe@perches.com>
To: LKML <linux-kernel@vger.kernel.org>
Subject: checkpatch doesn't recognize register or volatile declarations (was Re: [Outreachy kernel] [PATCH] staging: ralink-gdma: Move blank line to fix warning)
Date: Thu, 02 Apr 2020 20:10:57 -0700 [thread overview]
Message-ID: <8611a73f58a162f9dd5edca5f60fdca262a17756.camel@perches.com> (raw)
In-Reply-To: <3492c120971177bb0b523d78565130981acd1eda.camel@gmail.com>
(adding lkml)
On Thu, 2020-04-02 at 18:21 -0700, John B. Wyatt IV wrote:
> On Thu, 2020-04-02 at 11:31 +0200, Julia Lawall wrote:
> > On Thu, 2 Apr 2020, John B. Wyatt IV wrote:
> >
> > > Move a blank line within a struct to fix/silence a style warning.
> > >
> > > Reported by checkpatch.
> > >
> > > Signed-off-by: John B. Wyatt IV <jbwyatt4@gmail.com>
> > > ---
> > > Note:
> > > ralink-gdma does not build; even with make allyesconfig.
> > > I did not find a menu option with make menuconfig.
> > >
> > > drivers/staging/ralink-gdma/ralink-gdma.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/staging/ralink-gdma/ralink-gdma.c
> > > b/drivers/staging/ralink-gdma/ralink-gdma.c
> > > index eabf1093328e..9c398048daac 100644
> > > --- a/drivers/staging/ralink-gdma/ralink-gdma.c
> > > +++ b/drivers/staging/ralink-gdma/ralink-gdma.c
> > > @@ -122,9 +122,9 @@ struct gdma_dma_dev {
> > > struct gdma_data *data;
> > > void __iomem *base;
> > > struct tasklet_struct task;
> > > +
> >
> > Adding a blank line here is not correct. checkpatch is confused.
>
> It is not, but I was unsure of how this should be addressed. Thank you
> for letting me know.
>
> The second version of the patch removes the blank line.
>
> > Perhaps
> > it lacks a pattern considering wolatile to indicate a type.
>
> I have CC'ed Joe Perches on this.
>
Well, perhaps this, but it might cause other undesired change.
I haven't tested it much.
Maybe for older c, this list should even include "auto" too.
btw: the linux kernel sources do not have a single instance of
auto as far as I can tell with a trivial search.
---
scripts/checkpatch.pl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d64c67..e906a8 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -372,6 +372,8 @@ our $InitAttribute = qr{$InitAttributeData|$InitAttributeConst|$InitAttributeIni
# We need \b after 'init' otherwise 'initconst' will cause a false positive in a check
our $Attribute = qr{
const|
+ volatile|
+ register|
__percpu|
__nocast|
__safe|
parent reply other threads:[~2020-04-03 3:13 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <3492c120971177bb0b523d78565130981acd1eda.camel@gmail.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8611a73f58a162f9dd5edca5f60fdca262a17756.camel@perches.com \
--to=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).