Skip to contentSkip to conversation

Staging: comedi: drivers: fixed a coding style issue.

PATCH In review Nicolas Del Piano 3 participants 4 messages Apr 25, 2014 – Apr 26, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: comedi: drivers: fixed a coding style issue.

Quoted 1 line

From 38e0d5778bd97062115e7d8a8ca40d18f3d71707 Mon Sep 17 00:00:00 2001

From: Nicolas Del Piano <[email protected]>
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.

---
 drivers/staging/comedi/drivers.c |    1 +
 1 file changed, 1 insertion(+)
drivers/staging/comedi/drivers.c +1 -0
index cb5d214..71569bc 100644
@@ -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",
Signature · 1 line
1.7.9.5
#1 lore raw

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

Quoted 7 lines · Nicolas Del Piano
Quoted 2 lines

From 38e0d5778bd97062115e7d8a8ca40d18f3d71707 Mon Sep 17 00:00:00 2001

From: Nicolas Del Piano <[email protected]>
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.

Quoted 12 lines

Fixed a coding style issue.

---
 drivers/staging/comedi/drivers.c |    1 +
 1 file changed, 1 insertion(+)
drivers/staging/comedi/drivers.c +0 -0
index cb5d214..71569bc 100644

drivers/staging/comedi/drivers.c static void *comedi_recognize(struct comedi_driver *driv, const char *name) · line 443

Quoted 5 lines
drivers/staging/comedi/drivers.c +1 -0
@@ -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

maintainer
#2 lore raw

RFC PATCH 1/1 checkpatch: allow multiple const * types

Quoted 2 lines · Dan Carpenter

drivers/staging/comedi/drivers.c

Quoted 1 line · Nicolas Del Piano
drivers/staging/comedi/drivers.c +0 -0

[]

Quoted 10 lines

drivers/staging/comedi/drivers.c static void *comedi_recognize(struct comedi_driver *driv, const char *name) · line 443

Quoted 6 lines
drivers/staging/comedi/drivers.c +1 -0
@@ -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(-)
scripts/checkpatch.pl +1 -1
index 89f44f1..daa4767 100755
@@ -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};
#3 lore raw

Re: [rfc PATCH] checkpatch: allow multiple const * types

Quoted 15 lines · Joe Perches
Quoted 2 lines · Dan Carpenter

drivers/staging/comedi/drivers.c

Quoted 1 line · Nicolas Del Piano
drivers/staging/comedi/drivers.c +0 -0

[]

Quoted 10 lines

drivers/staging/comedi/drivers.c static void *comedi_recognize(struct comedi_driver *driv, const char *name) · line 443

Quoted 6 lines
drivers/staging/comedi/drivers.c +1 -0
@@ -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.

Quoted 4 lines

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