Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1698660 > unrolled thread

[PATCH] drivers:staging:wlan-ng Correct multiple line dereference

Started byjanani-sankarababu <jananis37@gmail.com>
First post2017-07-28 12:10 +0200
Last post2017-07-28 12:40 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] drivers:staging:wlan-ng Correct multiple line dereference janani-sankarababu <jananis37@gmail.com> - 2017-07-28 12:10 +0200
    Re: [PATCH] drivers:staging:wlan-ng Correct multiple line dereference Dan Carpenter <dan.carpenter@oracle.com> - 2017-07-28 12:30 +0200
    Re: [PATCH] drivers:staging:wlan-ng Correct multiple line  dereference Joe Perches <joe@perches.com> - 2017-07-28 12:40 +0200

#1698660 — [PATCH] drivers:staging:wlan-ng Correct multiple line dereference

Fromjanani-sankarababu <jananis37@gmail.com>
Date2017-07-28 12:10 +0200
Subject[PATCH] drivers:staging:wlan-ng Correct multiple line dereference
Message-ID<u8anw-2mH-17@gated-at.bofh.it>
This patch fixes multiple line dereference Warning reported by checkpath script. This has been made to simplify the code and make it more readable.

Signed-off-by: Janani S <jananis37@gmail.com>
---
 drivers/staging/wlan-ng/hfa384x_usb.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index ee5fa86..2fc5f3e 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -1345,15 +1345,13 @@ static int hfa384x_usbctlx_complete_sync(struct hfa384x *hw,
 		kfree(ctlx);
 	} else if (mode == DOWAIT) {
 		struct usbctlx_cmd_completor completor;
+		struct usbctlx_completor *cmplt;
+
+		cmplt = 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));
+		    hfa384x_usbctlx_complete_sync(hw, ctlx, cmplt);
 	}

done:
--
1.9.1

[toc] | [next] | [standalone]


#1698673

FromDan Carpenter <dan.carpenter@oracle.com>
Date2017-07-28 12:30 +0200
Message-ID<u8aGS-2tk-13@gated-at.bofh.it>
In reply to#1698660
Fix your email From header to match your Signed-off-by line.  The
subject should be:

[PATCH] staging: wlan-ng: Correct multiple line dereference

On Fri, Jul 28, 2017 at 03:33:27PM +0530, janani-sankarababu wrote:
> This patch fixes multiple line dereference Warning reported by checkpath script. This has been made to simplify the code and make it more readable.

Break this line up at the 70 character mark.

> 
> Signed-off-by: Janani S <jananis37@gmail.com>

Use your full legal name as if you were signing a legal document to
certify that you haven't stolen this code from Darl McBride.

> ---
>  drivers/staging/wlan-ng/hfa384x_usb.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
> index ee5fa86..2fc5f3e 100644
> --- a/drivers/staging/wlan-ng/hfa384x_usb.c
> +++ b/drivers/staging/wlan-ng/hfa384x_usb.c
> @@ -1345,15 +1345,13 @@ static int hfa384x_usbctlx_complete_sync(struct hfa384x *hw,
>  		kfree(ctlx);
>  	} else if (mode == DOWAIT) {
>  		struct usbctlx_cmd_completor completor;
> +		struct usbctlx_completor *cmplt;
> +
> +		cmplt = 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));
> +		    hfa384x_usbctlx_complete_sync(hw, ctlx, cmplt);


Move this to the previous line:

		result = hfa384x_usbctlx_complete_sync(hw, ctlx, cmplt);

Also the patch got corrupted by your email client so it can't apply.

Read Documentation/process/email-clients.rst

But generally this is a nice little cleanup.  Please resend a v2
version.

regards,
dan carpenter

[toc] | [prev] | [next] | [standalone]


#1698679 — Re: [PATCH] drivers:staging:wlan-ng Correct multiple line dereference

FromJoe Perches <joe@perches.com>
Date2017-07-28 12:40 +0200
SubjectRe: [PATCH] drivers:staging:wlan-ng Correct multiple line dereference
Message-ID<u8aQx-2wA-7@gated-at.bofh.it>
In reply to#1698660
On Fri, 2017-07-28 at 15:33 +0530, janani-sankarababu wrote:
> This patch fixes multiple line dereference Warning reported by checkpath script. This has been made to simplify the code and make it more readable.

Please wrap your commit messages to 75 characters per line.

And run your suggested patches though checkpatch too.

> diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
[]
> @@ -1345,15 +1345,13 @@ static int hfa384x_usbctlx_complete_sync(struct hfa384x *hw,
>  		kfree(ctlx);
>  	} else if (mode == DOWAIT) {
>  		struct usbctlx_cmd_completor completor;
> +		struct usbctlx_completor *cmplt;
> +
> +		cmplt = 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));
> +		    hfa384x_usbctlx_complete_sync(hw, ctlx, cmplt);

This should now be a single line

		result = hfa384x_usbctlx_complete_sync(hw, ctlx, cmplt);

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web