Skip to contentSkip to conversation

Staging: comedi: mite: added spaces around | and *

PATCH In review Philippe Loctaux 3 participants 7 messages Feb 22, 2016 – Feb 23, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: comedi: mite: added spaces around | and *

Added spaces around | and *, fixing 2 checkpatch checks.

---
 drivers/staging/comedi/drivers/mite.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/comedi/drivers/mite.c +2 -2
index 8f24702..d5cd4f3 100644
@@ -51,7 +51,7 @@
 
 #include "mite.h"
 
-#define TOP_OF_PAGE(x) ((x)|(~(PAGE_MASK)))
+#define TOP_OF_PAGE(x) ((x) | (~(PAGE_MASK)))
 
 struct mite_struct *mite_alloc(struct pci_dev *pcidev)
 {
@@ -216,7 +216,7 @@ EXPORT_SYMBOL_GPL(mite_free_ring);
 struct mite_channel *mite_request_channel_in_range(struct mite_struct *mite,
 						   struct
 						   mite_dma_descriptor_ring
-						   *ring, unsigned min_channel,
+						   * ring, unsigned min_channel,
 						   unsigned max_channel)
 {
 	int i;
Signature · 1 line
2.7.1
#1 lore raw
Quoted 1 line · Philippe Loctaux

Added spaces around | and *, fixing 2 checkpatch checks.

[]

drivers/staging/comedi/drivers/mite.c

Quoted 1 line
drivers/staging/comedi/drivers/mite.c +0 -0

[]

drivers/staging/comedi/drivers/mite.c line 54

Quoted 6 lines
drivers/staging/comedi/drivers/mite.c +0 -0
@@ -51,7 +51,7 @@


 #include "mite.h"

drivers/staging/comedi/drivers/mite.c +1 -1
-#define TOP_OF_PAGE(x) ((x)|(~(PAGE_MASK)))
+#define TOP_OF_PAGE(x) ((x) | (~(PAGE_MASK)))

It'd be nice to remove superfluous parentheses here too

+#define TOP_OF_PAGE(x) ((x) | ~PAGE_MASK)

#2 lore raw
Quoted 7 lines · Joe Perches
Quoted 1 line · Philippe Loctaux

Added spaces around | and *, fixing 2 checkpatch checks.

[]

drivers/staging/comedi/drivers/mite.c

Quoted 1 line
drivers/staging/comedi/drivers/mite.c +0 -0

[]

Quoted 2 lines
drivers/staging/comedi/drivers/mite.c +0 -0
@@ -51,7 +51,7 @@
 
Quoted 9 lines

drivers/staging/comedi/drivers/mite.c line 54

Quoted 4 lines
drivers/staging/comedi/drivers/mite.c +1 -1
  #include "mite.h"
 
-#define TOP_OF_PAGE(x) ((x)|(~(PAGE_MASK)))
+#define TOP_OF_PAGE(x) ((x) | (~(PAGE_MASK)))

It'd be nice to remove superfluous parentheses here too

+#define TOP_OF_PAGE(x) ((x) | ~PAGE_MASK)

Even better: just remove the macro, as it isn't used.

Signature · 2 lines
-=( Ian Abbott @ MEV Ltd.    E-mail: <[email protected]> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
#3 lore raw
Quoted 1 line · Ian Abbott

Even better: just remove the macro, as it isn't used.

How can I do that? I'm asking that because my C knowledge isn't very good :P

--
Philippe Loctaux
[email protected]

#4 lore raw
Quoted 4 lines · Philippe Loctaux
Quoted 1 line · Ian Abbott

Even better: just remove the macro, as it isn't used.

How can I do that? I'm asking that because my C knowledge isn't very good :P

Are you sure you should be writing kernel patches in that case?

It means, just delete the macro definition.

Signature · 2 lines
-=( Ian Abbott @ MEV Ltd.    E-mail: <[email protected]> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
#5 lore raw
In reply to Philippe Loctaux
Quoted 6 lines · Philippe Loctaux

Added spaces around | and *, fixing 2 checkpatch checks.

---
  drivers/staging/comedi/drivers/mite.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

[snip]

drivers/staging/comedi/drivers/mite.c EXPORT_SYMBOL_GPL(mite_free_ring); · line 220

Quoted 7 lines
drivers/staging/comedi/drivers/mite.c +1 -1
@@ -216,7 +216,7 @@ EXPORT_SYMBOL_GPL(mite_free_ring);
  struct mite_channel *mite_request_channel_in_range(struct mite_struct *mite,
  						   struct
  						   mite_dma_descriptor_ring
-						   *ring, unsigned min_channel,
+						   * ring, unsigned min_channel,
  						   unsigned max_channel)

Actually, that one looks like a false positive by the checkpatch tool. I'd expect no space after that '*'. checkpatch has probably got confused by the line-break before the '*'.

It looks a bit ugly anyway. It would look better if there was a line-break before the function name, the same as in "drivers/staging/comedi/drivers/mite.h":

struct mite_channel *
mite_request_channel_in_range(struct mite_struct *mite,
struct mite_dma_descriptor_ring *ring, unsigned min_channel, unsigned max_channel)

Signature · 2 lines
-=( Ian Abbott @ MEV Ltd.    E-mail: <[email protected]> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
#6 lore raw
Quoted 3 lines · Ian Abbott

Actually, that one looks like a false positive by the checkpatch tool. I'd expect no space after that '*'. checkpatch has probably got confused by the line-break before the '*'.

I see, I think I'll end up resending another patch without changing this line, to avoid any bugs or breaking some style rules.

--
Philippe Loctaux
[email protected]