All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: comedi: mite: added spaces around | and *
@ 2016-02-22 23:38 Philippe Loctaux
  2016-02-23  0:37 ` Joe Perches
  2016-02-23 16:48 ` Ian Abbott
  0 siblings, 2 replies; 7+ messages in thread
From: Philippe Loctaux @ 2016-02-22 23:38 UTC (permalink / raw)
  To: gregkh; +Cc: abbotti, hsweeten, devel, linux-kernel, Philippe Loctaux

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

Signed-off-by: Philippe Loctaux <phil@philippeloctaux.com>
---
 drivers/staging/comedi/drivers/mite.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/mite.c b/drivers/staging/comedi/drivers/mite.c
index 8f24702..d5cd4f3 100644
--- a/drivers/staging/comedi/drivers/mite.c
+++ b/drivers/staging/comedi/drivers/mite.c
@@ -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;
-- 
2.7.1

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

* Re: [PATCH] Staging: comedi: mite: added spaces around | and *
  2016-02-22 23:38 [PATCH] Staging: comedi: mite: added spaces around | and * Philippe Loctaux
@ 2016-02-23  0:37 ` Joe Perches
  2016-02-23 11:07   ` Ian Abbott
  2016-02-23 16:48 ` Ian Abbott
  1 sibling, 1 reply; 7+ messages in thread
From: Joe Perches @ 2016-02-23  0:37 UTC (permalink / raw)
  To: Philippe Loctaux, gregkh; +Cc: abbotti, hsweeten, devel, linux-kernel

On Tue, 2016-02-23 at 00:38 +0100, Philippe Loctaux wrote:
> Added spaces around | and *, fixing 2 checkpatch checks.
[]
> diff --git a/drivers/staging/comedi/drivers/mite.c b/drivers/staging/comedi/drivers/mite.c
[]
> @@ -51,7 +51,7 @@
>  
>  #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)

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

* Re: [PATCH] Staging: comedi: mite: added spaces around | and *
  2016-02-23  0:37 ` Joe Perches
@ 2016-02-23 11:07   ` Ian Abbott
  2016-02-23 12:38     ` Philippe Loctaux
  0 siblings, 1 reply; 7+ messages in thread
From: Ian Abbott @ 2016-02-23 11:07 UTC (permalink / raw)
  To: Joe Perches, Philippe Loctaux, gregkh; +Cc: hsweeten, devel, linux-kernel

On 23/02/16 00:37, Joe Perches wrote:
> On Tue, 2016-02-23 at 00:38 +0100, Philippe Loctaux wrote:
>> Added spaces around | and *, fixing 2 checkpatch checks.
> []
>> diff --git a/drivers/staging/comedi/drivers/mite.c b/drivers/staging/comedi/drivers/mite.c
> []
>> @@ -51,7 +51,7 @@
>>
>>   #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.

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

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

* Re: [PATCH] Staging: comedi: mite: added spaces around | and *
  2016-02-23 11:07   ` Ian Abbott
@ 2016-02-23 12:38     ` Philippe Loctaux
  2016-02-23 16:39       ` Ian Abbott
  0 siblings, 1 reply; 7+ messages in thread
From: Philippe Loctaux @ 2016-02-23 12:38 UTC (permalink / raw)
  To: Ian Abbott; +Cc: Joe Perches, gregkh, hsweeten, devel, linux-kernel

On Tue, Feb 23, 2016 at 11:07:15AM +0000, Ian Abbott wrote:
> 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
phil@philippeloctaux.com

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

* Re: [PATCH] Staging: comedi: mite: added spaces around | and *
  2016-02-23 12:38     ` Philippe Loctaux
@ 2016-02-23 16:39       ` Ian Abbott
  0 siblings, 0 replies; 7+ messages in thread
From: Ian Abbott @ 2016-02-23 16:39 UTC (permalink / raw)
  To: Philippe Loctaux; +Cc: Joe Perches, gregkh, hsweeten, devel, linux-kernel

On 23/02/16 12:38, Philippe Loctaux wrote:
> On Tue, Feb 23, 2016 at 11:07:15AM +0000, Ian Abbott wrote:
>> 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.

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

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

* Re: [PATCH] Staging: comedi: mite: added spaces around | and *
  2016-02-22 23:38 [PATCH] Staging: comedi: mite: added spaces around | and * Philippe Loctaux
  2016-02-23  0:37 ` Joe Perches
@ 2016-02-23 16:48 ` Ian Abbott
  2016-02-23 21:47   ` Philippe Loctaux
  1 sibling, 1 reply; 7+ messages in thread
From: Ian Abbott @ 2016-02-23 16:48 UTC (permalink / raw)
  To: Philippe Loctaux, gregkh; +Cc: hsweeten, devel, linux-kernel

On 22/02/16 23:38, Philippe Loctaux wrote:
> Added spaces around | and *, fixing 2 checkpatch checks.
>
> Signed-off-by: Philippe Loctaux <phil@philippeloctaux.com>
> ---
>   drivers/staging/comedi/drivers/mite.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
[snip]
> @@ -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)

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

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

* Re: [PATCH] Staging: comedi: mite: added spaces around | and *
  2016-02-23 16:48 ` Ian Abbott
@ 2016-02-23 21:47   ` Philippe Loctaux
  0 siblings, 0 replies; 7+ messages in thread
From: Philippe Loctaux @ 2016-02-23 21:47 UTC (permalink / raw)
  To: Ian Abbott; +Cc: gregkh, hsweeten, devel, linux-kernel

On Tue, Feb 23, 2016 at 04:48:23PM +0000, Ian Abbott wrote:
> 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
phil@philippeloctaux.com

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

end of thread, other threads:[~2016-02-23 23:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-22 23:38 [PATCH] Staging: comedi: mite: added spaces around | and * Philippe Loctaux
2016-02-23  0:37 ` Joe Perches
2016-02-23 11:07   ` Ian Abbott
2016-02-23 12:38     ` Philippe Loctaux
2016-02-23 16:39       ` Ian Abbott
2016-02-23 16:48 ` Ian Abbott
2016-02-23 21:47   ` Philippe Loctaux

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.