staging: wlan-ng: fix checkpatch.pl code style warnings
PATCH 1/1 staging: wlan-ng: fix checkpatch.pl code style warnings
Fixed code style warnings reported by checkpatch.pl script.
drivers/staging/wlan-ng/hfa384x_usb.c +4 -8
@@ -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:
Greg KH
maintainerQuoted 1 line · Andrii
Fixed code style warnings reported by checkpatch.pl script.
What warning would that be? Please always be very specific.
Quoted 2 lines
Signed-off-by Andrii Vladyka <[email protected]>
Trailing whitespace on this line :(
Quoted 10 lines
drivers/staging/wlan-ng/hfa384x_usb.c +0
-2@@ -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,
drivers/staging/wlan-ng/hfa384x_usb.c hfa384x_docmd(struct hfa384x *hw, · line 1352
Quoted 10 lines
drivers/staging/wlan-ng/hfa384x_usb.c +4
-6-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
PATCH v2 1/1 staging: wlan-ng: fix avoid multiple line dereference warning reported by checkpatch.pl
In reply to AndriiFixed three code style warnings (multiple line dereference) reported by checkpatch.pl script.
drivers/staging/wlan-ng/hfa384x_usb.c +2 -8
@@ -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:
Greg KH
maintainerRe: [PATCHv2] staging: wlan-ng: fix avoid multiple line dereference warning reported by checkpatch.pl
Quoted 13 lines · Andrii
Fixed three code style warnings (multiple line dereference) reported by checkpatch.pl script.
Signed-off-by Andrii Vladyka <[email protected]>drivers/staging/wlan-ng/hfa384x_usb.c +0
-0@@ -1346,14 +1346,8 @@ hfa384x_docmd(struct hfa384x *hw, }else if (mode ==DOWAIT ) {struct usbctlx_cmd_completor completor;
drivers/staging/wlan-ng/hfa384x_usb.c hfa384x_docmd(struct hfa384x *hw, · line 1350
Quoted 10 lines
drivers/staging/wlan-ng/hfa384x_usb.c +2
-8- 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
Re: [PATCHv2] staging: wlan-ng: fix avoid multiple line dereference warning reported by checkpatch.pl
Quoted 35 lines · On Sun, 12 Mar 2017 16:42:07 +0100 Greg KH <[email protected]> wrote:
Quoted 29 lines · Andrii
Fixed three code style warnings (multiple line dereference) reported by checkpatch.pl script.
Signed-off-by Andrii Vladyka <[email protected]>(quoted diff) +0
-0
b/drivers/staging/wlan-ng/hfa384x_usb.cindex 6134eba..a050748 100644 ---a/drivers/staging/wlan-ng/hfa384x_usb.c+++b/drivers/staging/wlan-ng/hfa384x_usb.cdrivers/staging/wlan-ng/hfa384x_usb.c +0
-4@@ -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));(quoted diff) +2
-0+ result = hfa384x_usbctlx_complete_sync(hw, ctlx, + init_cmd_completor(&completor, &ctlx->inbuf.cmdresp,Quoted 1 line
&cmd->result))Hm, did you run your patch through checkpatch? There's no way that his code is correct :(
Quoted 1 line
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
Greg KH
maintainerRe: [PATCHv2] staging: wlan-ng: fix avoid multiple line dereference warning reported by checkpatch.pl
Quoted 38 lines · Andrii
Quoted 35 lines · On Sun, 12 Mar 2017 16:42:07 +0100 Greg KH <[email protected]> wrote:
Quoted 29 lines · Andrii
Fixed three code style warnings (multiple line dereference) reported by checkpatch.pl script.
Signed-off-by Andrii Vladyka <[email protected]>(quoted diff) +0
-0
b/drivers/staging/wlan-ng/hfa384x_usb.cindex 6134eba..a050748 100644 ---a/drivers/staging/wlan-ng/hfa384x_usb.c+++b/drivers/staging/wlan-ng/hfa384x_usb.cdrivers/staging/wlan-ng/hfa384x_usb.c +0
-4@@ -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));(quoted diff) +2
-0+ result = hfa384x_usbctlx_complete_sync(hw, ctlx, + init_cmd_completor(&completor, &ctlx->inbuf.cmdresp,Quoted 1 line
&cmd->result))Hm, did you run your patch through checkpatch? There's no way that his code is correct :(
Quoted 5 lines
Quoted 1 line
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
Greg KH
maintainerRe: [PATCHv2] staging: wlan-ng: fix avoid multiple line dereference warning reported by checkpatch.pl
In reply to AndriiQuoted 12 lines · Andrii
Fixed three code style warnings (multiple line dereference) reported by checkpatch.pl script.
Signed-off-by Andrii Vladyka <[email protected]>drivers/staging/wlan-ng/hfa384x_usb.c +0
-0@@ -1346,14 +1346,8 @@ hfa384x_docmd(struct hfa384x *hw, }else if (mode ==DOWAIT ) {struct usbctlx_cmd_completor completor;
drivers/staging/wlan-ng/hfa384x_usb.c hfa384x_docmd(struct hfa384x *hw, · line 1350
Quoted 10 lines
drivers/staging/wlan-ng/hfa384x_usb.c +2
-8- 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