public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: wlan-ng: fix checkpatch.pl code style warnings
@ 2017-03-11 20:39 Andrii
  2017-03-12 14:16 ` Greg KH
  2017-03-12 15:30 ` [PATCHv2] staging: wlan-ng: fix avoid multiple line dereference warning reported by checkpatch.pl Andrii
  0 siblings, 2 replies; 7+ messages in thread
From: Andrii @ 2017-03-11 20:39 UTC (permalink / raw)
  To: gregkh; +Cc: sergio.paracuellos, devel, linux-kernel

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

Fixed code style warnings reported by checkpatch.pl script.

Signed-off-by: Andrii Vladyka <tulup@mail.ru> 

[-- Attachment #2: hfa384x_usb.patch --]
[-- Type: text/x-patch, Size: 710 bytes --]

diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index 6134eba..d7d2d13 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -1346,14 +1346,10 @@ hfa384x_docmd(struct hfa384x *hw,
 	} else if (mode == DOWAIT) {
 		struct usbctlx_cmd_completor completor;
 
-		result =
-		    hfa384x_usbctlx_complete_sync(hw, ctlx,
-						  init_cmd_completor(&completor,
-								     &ctlx->
-								     inbuf.
-								     cmdresp,
-								     &cmd->
-								     result));
+		result = hfa384x_usbctlx_complete_sync(hw, ctlx,
+						init_cmd_completor(&completor,
+							&ctlx->inbuf.cmdresp,
+							&cmd->result));
 	}
 
 done:

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

* Re: [PATCH] staging: wlan-ng: fix checkpatch.pl code style warnings
  2017-03-11 20:39 [PATCH] staging: wlan-ng: fix checkpatch.pl code style warnings Andrii
@ 2017-03-12 14:16 ` Greg KH
  2017-03-12 15:30 ` [PATCHv2] staging: wlan-ng: fix avoid multiple line dereference warning reported by checkpatch.pl Andrii
  1 sibling, 0 replies; 7+ messages in thread
From: Greg KH @ 2017-03-12 14:16 UTC (permalink / raw)
  To: Andrii; +Cc: sergio.paracuellos, devel, linux-kernel

On Sat, Mar 11, 2017 at 10:39:56PM +0200, Andrii wrote:
> Fixed code style warnings reported by checkpatch.pl script.

What warning would that be?  Please always be very specific.

> 
> Signed-off-by: Andrii Vladyka <tulup@mail.ru> 

Trailing whitespace on this line :(


> diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
> index 6134eba..d7d2d13 100644
> --- a/drivers/staging/wlan-ng/hfa384x_usb.c
> +++ b/drivers/staging/wlan-ng/hfa384x_usb.c
> @@ -1346,14 +1346,10 @@ hfa384x_docmd(struct hfa384x *hw,
>  	} else if (mode == DOWAIT) {
>  		struct usbctlx_cmd_completor completor;
>  
> -		result =
> -		    hfa384x_usbctlx_complete_sync(hw, ctlx,
> -						  init_cmd_completor(&completor,
> -								     &ctlx->
> -								     inbuf.
> -								     cmdresp,
> -								     &cmd->
> -								     result));
> +		result = hfa384x_usbctlx_complete_sync(hw, ctlx,
> +						init_cmd_completor(&completor,
> +							&ctlx->inbuf.cmdresp,
> +							&cmd->result));

It's still a pain to read, can't there be a better way to rewite the
code to be readable?

thanks,

greg k-h

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

* [PATCHv2] staging: wlan-ng: fix avoid multiple line dereference  warning reported by checkpatch.pl
  2017-03-11 20:39 [PATCH] staging: wlan-ng: fix checkpatch.pl code style warnings Andrii
  2017-03-12 14:16 ` Greg KH
@ 2017-03-12 15:30 ` Andrii
  2017-03-12 15:42   ` Greg KH
  2017-03-29  7:32   ` Greg KH
  1 sibling, 2 replies; 7+ messages in thread
From: Andrii @ 2017-03-12 15:30 UTC (permalink / raw)
  To: gregkh; +Cc: sergio.paracuellos, devel, linux-kernel

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

Fixed three code style warnings (multiple line dereference) reported
by checkpatch.pl script.

Signed-off-by: Andrii Vladyka <tulup@mail.ru>

[-- Attachment #2: hfa384x_usb.patch --]
[-- Type: text/x-patch, Size: 687 bytes --]

diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index 6134eba..a050748 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -1346,14 +1346,8 @@ hfa384x_docmd(struct hfa384x *hw,
 	} else if (mode == DOWAIT) {
 		struct usbctlx_cmd_completor completor;
 
-		result =
-		    hfa384x_usbctlx_complete_sync(hw, ctlx,
-						  init_cmd_completor(&completor,
-								     &ctlx->
-								     inbuf.
-								     cmdresp,
-								     &cmd->
-								     result));
+		result = hfa384x_usbctlx_complete_sync(hw, ctlx,
+	init_cmd_completor(&completor, &ctlx->inbuf.cmdresp, &cmd->result))
 	}
 
 done:

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

* Re: [PATCHv2] staging: wlan-ng: fix avoid multiple line dereference warning reported by checkpatch.pl
  2017-03-12 15:30 ` [PATCHv2] staging: wlan-ng: fix avoid multiple line dereference warning reported by checkpatch.pl Andrii
@ 2017-03-12 15:42   ` Greg KH
  2017-03-12 15:47     ` Andrii
  2017-03-29  7:32   ` Greg KH
  1 sibling, 1 reply; 7+ messages in thread
From: Greg KH @ 2017-03-12 15:42 UTC (permalink / raw)
  To: Andrii; +Cc: devel, sergio.paracuellos, linux-kernel

On Sun, Mar 12, 2017 at 05:30:09PM +0200, Andrii wrote:
> Fixed three code style warnings (multiple line dereference) reported
> by checkpatch.pl script.
> 
> Signed-off-by: Andrii Vladyka <tulup@mail.ru>

> diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
> index 6134eba..a050748 100644
> --- a/drivers/staging/wlan-ng/hfa384x_usb.c
> +++ b/drivers/staging/wlan-ng/hfa384x_usb.c
> @@ -1346,14 +1346,8 @@ hfa384x_docmd(struct hfa384x *hw,
>  	} else if (mode == DOWAIT) {
>  		struct usbctlx_cmd_completor completor;
>  
> -		result =
> -		    hfa384x_usbctlx_complete_sync(hw, ctlx,
> -						  init_cmd_completor(&completor,
> -								     &ctlx->
> -								     inbuf.
> -								     cmdresp,
> -								     &cmd->
> -								     result));
> +		result = hfa384x_usbctlx_complete_sync(hw, ctlx,
> +	init_cmd_completor(&completor, &ctlx->inbuf.cmdresp, &cmd->result))

Hm, did you run your patch through checkpatch?  There's no way that his
code is correct :(

greg k-h

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

* Re: [PATCHv2] staging: wlan-ng: fix avoid multiple line dereference warning reported by checkpatch.pl
  2017-03-12 15:42   ` Greg KH
@ 2017-03-12 15:47     ` Andrii
  2017-03-12 16:24       ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Andrii @ 2017-03-12 15:47 UTC (permalink / raw)
  To: Greg KH; +Cc: devel, sergio.paracuellos, linux-kernel

On Sun, 12 Mar 2017 16:42:07 +0100
Greg KH <gregkh@linuxfoundation.org> wrote:

> On Sun, Mar 12, 2017 at 05:30:09PM +0200, Andrii wrote:
> > Fixed three code style warnings (multiple line dereference) reported
> > by checkpatch.pl script.
> > 
> > Signed-off-by: Andrii Vladyka <tulup@mail.ru>  
> 
> > diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c
> > b/drivers/staging/wlan-ng/hfa384x_usb.c index 6134eba..a050748
> > 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c
> > +++ b/drivers/staging/wlan-ng/hfa384x_usb.c
> > @@ -1346,14 +1346,8 @@ hfa384x_docmd(struct hfa384x *hw,
> >  	} else if (mode == DOWAIT) {
> >  		struct usbctlx_cmd_completor completor;
> >  
> > -		result =
> > -		    hfa384x_usbctlx_complete_sync(hw, ctlx,
> > -
> > init_cmd_completor(&completor,
> > -
> > &ctlx->
> > -
> > inbuf.
> > -
> > cmdresp,
> > -
> > &cmd->
> > -
> > result));
> > +		result = hfa384x_usbctlx_complete_sync(hw, ctlx,
> > +	init_cmd_completor(&completor, &ctlx->inbuf.cmdresp,
> > &cmd->result))  
> 
> Hm, did you run your patch through checkpatch?  There's no way that
> his code is correct :(
> 
> greg k-h

Yes, I did. The code is correct. Checkpatch now reports "Alignment
should match open parenthesis" CHECK, which is obviously better than
original WARNING.

Regards,
Andrii

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

* Re: [PATCHv2] staging: wlan-ng: fix avoid multiple line dereference warning reported by checkpatch.pl
  2017-03-12 15:47     ` Andrii
@ 2017-03-12 16:24       ` Greg KH
  0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2017-03-12 16:24 UTC (permalink / raw)
  To: Andrii; +Cc: devel, sergio.paracuellos, linux-kernel

On Sun, Mar 12, 2017 at 05:47:33PM +0200, Andrii wrote:
> On Sun, 12 Mar 2017 16:42:07 +0100
> Greg KH <gregkh@linuxfoundation.org> wrote:
> 
> > On Sun, Mar 12, 2017 at 05:30:09PM +0200, Andrii wrote:
> > > Fixed three code style warnings (multiple line dereference) reported
> > > by checkpatch.pl script.
> > > 
> > > Signed-off-by: Andrii Vladyka <tulup@mail.ru>  
> > 
> > > diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c
> > > b/drivers/staging/wlan-ng/hfa384x_usb.c index 6134eba..a050748
> > > 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c
> > > +++ b/drivers/staging/wlan-ng/hfa384x_usb.c
> > > @@ -1346,14 +1346,8 @@ hfa384x_docmd(struct hfa384x *hw,
> > >  	} else if (mode == DOWAIT) {
> > >  		struct usbctlx_cmd_completor completor;
> > >  
> > > -		result =
> > > -		    hfa384x_usbctlx_complete_sync(hw, ctlx,
> > > -
> > > init_cmd_completor(&completor,
> > > -
> > > &ctlx->
> > > -
> > > inbuf.
> > > -
> > > cmdresp,
> > > -
> > > &cmd->
> > > -
> > > result));
> > > +		result = hfa384x_usbctlx_complete_sync(hw, ctlx,
> > > +	init_cmd_completor(&completor, &ctlx->inbuf.cmdresp,
> > > &cmd->result))  
> > 
> > Hm, did you run your patch through checkpatch?  There's no way that
> > his code is correct :(
> > 
> > greg k-h
> 
> Yes, I did. The code is correct. Checkpatch now reports "Alignment
> should match open parenthesis" CHECK, which is obviously better than
> original WARNING.

Really?  No, it's much worse.  Indentation should be obvious when
looking at the code, right now this is just so wrong it hurts my brain
to look at (seriously, coding style is there for your brain, not because
we are crazy picky developers.)

Also you forgot a trailing ';' did that even compile?

thanks,

greg k-h

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

* Re: [PATCHv2] staging: wlan-ng: fix avoid multiple line dereference warning reported by checkpatch.pl
  2017-03-12 15:30 ` [PATCHv2] staging: wlan-ng: fix avoid multiple line dereference warning reported by checkpatch.pl Andrii
  2017-03-12 15:42   ` Greg KH
@ 2017-03-29  7:32   ` Greg KH
  1 sibling, 0 replies; 7+ messages in thread
From: Greg KH @ 2017-03-29  7:32 UTC (permalink / raw)
  To: Andrii; +Cc: sergio.paracuellos, devel, linux-kernel

On Sun, Mar 12, 2017 at 05:30:09PM +0200, Andrii wrote:
> Fixed three code style warnings (multiple line dereference) reported
> by checkpatch.pl script.
> 
> Signed-off-by: Andrii Vladyka <tulup@mail.ru>
> diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
> index 6134eba..a050748 100644
> --- a/drivers/staging/wlan-ng/hfa384x_usb.c
> +++ b/drivers/staging/wlan-ng/hfa384x_usb.c
> @@ -1346,14 +1346,8 @@ hfa384x_docmd(struct hfa384x *hw,
>  	} else if (mode == DOWAIT) {
>  		struct usbctlx_cmd_completor completor;
>  
> -		result =
> -		    hfa384x_usbctlx_complete_sync(hw, ctlx,
> -						  init_cmd_completor(&completor,
> -								     &ctlx->
> -								     inbuf.
> -								     cmdresp,
> -								     &cmd->
> -								     result));
> +		result = hfa384x_usbctlx_complete_sync(hw, ctlx,
> +	init_cmd_completor(&completor, &ctlx->inbuf.cmdresp, &cmd->result))

Ick, no, that doesn't look right, does it?

Please use your brain when making checkpatch changes, it's just a dumb
perl script...

greg k-h

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

end of thread, other threads:[~2017-03-29  7:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-11 20:39 [PATCH] staging: wlan-ng: fix checkpatch.pl code style warnings Andrii
2017-03-12 14:16 ` Greg KH
2017-03-12 15:30 ` [PATCHv2] staging: wlan-ng: fix avoid multiple line dereference warning reported by checkpatch.pl Andrii
2017-03-12 15:42   ` Greg KH
2017-03-12 15:47     ` Andrii
2017-03-12 16:24       ` Greg KH
2017-03-29  7:32   ` Greg KH

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