public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: comedi: drivers: fixed a  coding style issue.
@ 2014-04-25  4:06 Nicolas Del Piano
  2014-04-25  7:50 ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Del Piano @ 2014-04-25  4:06 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, mail, devel

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: 0001-Staging-comedi-drivers-fixed-a-missing-blank-line-af.patch --]
[-- Type: text/x-patch, Size: 898 bytes --]

>From 38e0d5778bd97062115e7d8a8ca40d18f3d71707 Mon Sep 17 00:00:00 2001
From: Nicolas Del Piano <ndel314@gmail.com>
Date: Thu, 24 Apr 2014 18:46:49 -0300
Subject: [PATCH] Staging: comedi: drivers: fixed a missing blank line after a
 declaration coding style.

Fixed a coding style issue.

Signed-off-by: Nicolas Del Piano <ndel314@gmail.com>
---
 drivers/staging/comedi/drivers.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index cb5d214..71569bc 100644
--- 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;
 
 	pr_info("comedi: valid board names for %s driver are:\n",
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Staging: comedi: drivers: fixed a  coding style issue.
  2014-04-25  4:06 [PATCH] Staging: comedi: drivers: fixed a coding style issue Nicolas Del Piano
@ 2014-04-25  7:50 ` Dan Carpenter
  2014-04-26  3:29   ` [rfc PATCH] checkpatch: allow multiple const * types Joe Perches
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2014-04-25  7:50 UTC (permalink / raw)
  To: Nicolas Del Piano; +Cc: gregkh, devel, linux-kernel, mail, Joe Perches

Patches need to be sent inline.  Perhaps use git send-email.


On Fri, Apr 25, 2014 at 01:06:44AM -0300, Nicolas Del Piano wrote:
> 
> >From 38e0d5778bd97062115e7d8a8ca40d18f3d71707 Mon Sep 17 00:00:00 2001
> From: Nicolas Del Piano <ndel314@gmail.com>
> Date: Thu, 24 Apr 2014 18:46:49 -0300
> Subject: [PATCH] Staging: comedi: drivers: fixed a missing blank line after a
>  declaration coding style.
> 

We don't want these headers in the patch.

> Fixed a coding style issue.
> 
> Signed-off-by: Nicolas Del Piano <ndel314@gmail.com>
> ---
>  drivers/staging/comedi/drivers.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
> index cb5d214..71569bc 100644
> --- 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.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [rfc PATCH] checkpatch: allow multiple const * types
  2014-04-25  7:50 ` Dan Carpenter
@ 2014-04-26  3:29   ` Joe Perches
  2014-04-26 19:52     ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2014-04-26  3:29 UTC (permalink / raw)
  To: Dan Carpenter, Andy Whitcroft, Andrew Morton
  Cc: Nicolas Del Piano, gregkh, devel, linux-kernel, mail

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};



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [rfc PATCH] checkpatch: allow multiple const * types
  2014-04-26  3:29   ` [rfc PATCH] checkpatch: allow multiple const * types Joe Perches
@ 2014-04-26 19:52     ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2014-04-26 19:52 UTC (permalink / raw)
  To: Joe Perches
  Cc: Andy Whitcroft, Andrew Morton, Nicolas Del Piano, gregkh, devel,
	linux-kernel, mail

On Fri, Apr 25, 2014 at 08:29:59PM -0700, Joe Perches wrote:
> 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.

No stress.  These are not a big deal.  These false positives are rare,
there is no way we would have applied the patch and even if we did then
the extra blank line is harmless.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-04-26 19:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-25  4:06 [PATCH] Staging: comedi: drivers: fixed a coding style issue Nicolas Del Piano
2014-04-25  7:50 ` Dan Carpenter
2014-04-26  3:29   ` [rfc PATCH] checkpatch: allow multiple const * types Joe Perches
2014-04-26 19:52     ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox