linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* checkpatch doesn't recognize register or volatile declarations (was Re: [Outreachy kernel] [PATCH] staging: ralink-gdma: Move blank line to fix warning)
       [not found]   ` <3492c120971177bb0b523d78565130981acd1eda.camel@gmail.com>
@ 2020-04-03  3:10     ` Joe Perches
  0 siblings, 0 replies; only message in thread
From: Joe Perches @ 2020-04-03  3:10 UTC (permalink / raw)
  To: LKML

(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|



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-03  3:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200402082309.839063-1-jbwyatt4@gmail.com>
     [not found] ` <alpine.DEB.2.21.2004021129490.3014@hadrien>
     [not found]   ` <3492c120971177bb0b523d78565130981acd1eda.camel@gmail.com>
2020-04-03  3:10     ` checkpatch doesn't recognize register or volatile declarations (was Re: [Outreachy kernel] [PATCH] staging: ralink-gdma: Move blank line to fix warning) Joe Perches

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).