[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1398482999.3071.8.camel@joe-AO725>
Date: Fri, 25 Apr 2014 20:29:59 -0700
From: Joe Perches <joe@...ches.com>
To: Dan Carpenter <dan.carpenter@...cle.com>,
Andy Whitcroft <apw@...dowen.org>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: Nicolas Del Piano <ndel314@...il.com>, gregkh@...uxfoundation.org,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
mail@...ndporr.me.uk
Subject: [rfc PATCH] checkpatch: allow multiple const * types
On Fri, 2014-04-25 at 10:50 +0300, Dan Carpenter wrote:
> On Fri, Apr 25, 2014 at 01:06:44AM -0300, Nicolas Del Piano wrote:
> > diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
[]
> > @@ -439,6 +439,7 @@ static void *comedi_recognize(struct comedi_driver *driv, const char *name)
> > static void comedi_report_boards(struct comedi_driver *driv)
> > {
> > unsigned int i;
> > +
> > const char *const *name_ptr;
>
> The original code was correct. This is a bug in checkpatch.pl. The
> missing line check should count any lines starting with "const" or
> "static" as declarations.
Right, thanks for the report.
I'm not around for a couple weeks.
I'll fix it properly later.
It looks like the $Type test in checkpatch
should allow multiple pointer declarations like
"const foo * const *"
instead of just
"const foo * const"
but it takes awhile to test that it doesn't stuff up
something else.
Andy? Any opinion of this?
---
scripts/checkpatch.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 89f44f1..daa4767 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -433,7 +433,7 @@ sub build_types {
}x;
$Type = qr{
$NonptrType
- (?:(?:\s|\*|\[\])+\s*const|(?:\s|\*|\[\])+|(?:\s*\[\s*\])+)?
+ (?:(?:\s|\*|\[\])+\s*const|(?:\s|\*|\[\])+|(?:\s*\[\s*\])+)*
(?:\s+$Inline|\s+$Modifier)*
}x;
$Declare = qr{(?:$Storage\s+(?:$Inline\s+)?)?$Type};
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists