diff mbox

hyperv: else branch not necessary

Message ID 1422175610-1924-1-git-send-email-der.herr@hofr.at
State Superseded, archived
Delegated to: David Miller
Headers show

Commit Message

Nicholas Mc Guire Jan. 25, 2015, 8:46 a.m. UTC
As the if completes with a unconditional goto the else branch
is not needed here.

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
---

All paths of execution that did not exit through the if branch will 
go through the else branch so no need for an explicit else here

Patch was compile tested only for x86_64_defconfig + CONFIG_X86_VSMP=y
CONFIG_HYPERV=m, CONFIG_HYPERV_NET=m

Patch is against 3.19.0-rc5 -next-20150123

 drivers/net/hyperv/rndis_filter.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

KY Srinivasan Jan. 25, 2015, 6:10 p.m. UTC | #1
> -----Original Message-----
> From: Nicholas Mc Guire [mailto:der.herr@hofr.at]
> Sent: Sunday, January 25, 2015 12:47 AM
> To: KY Srinivasan
> Cc: Haiyang Zhang; devel@linuxdriverproject.org; netdev@vger.kernel.org;
> linux-kernel@vger.kernel.org; Nicholas Mc Guire
> Subject: [PATCH] hyperv: else branch not necessary

Make the subject line clear as to  what subsystem this patch is for.

K. Y
> 
> As the if completes with a unconditional goto the else branch is not needed
> here.
> 
> Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
> ---
> 
> All paths of execution that did not exit through the if branch will go through
> the else branch so no need for an explicit else here
> 
> Patch was compile tested only for x86_64_defconfig + CONFIG_X86_VSMP=y
> CONFIG_HYPERV=m, CONFIG_HYPERV_NET=m
> 
> Patch is against 3.19.0-rc5 -next-20150123
> 
>  drivers/net/hyperv/rndis_filter.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/hyperv/rndis_filter.c
> b/drivers/net/hyperv/rndis_filter.c
> index 7bd8387..efb84a9 100644
> --- a/drivers/net/hyperv/rndis_filter.c
> +++ b/drivers/net/hyperv/rndis_filter.c
> @@ -833,10 +833,10 @@ int rndis_filter_set_packet_filter(struct
> rndis_device *dev, u32 new_filter)
>  		 * send completion for it.
>  		 */
>  		goto exit;
> -	} else {
> -		set_complete = &request-
> >response_msg.msg.set_complete;
> -		status = set_complete->status;
> -	}
> +	}
> +
> +	set_complete = &request->response_msg.msg.set_complete;
> +	status = set_complete->status;
> 
>  cleanup:
>  	if (request)
> --
> 1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
index 7bd8387..efb84a9 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -833,10 +833,10 @@  int rndis_filter_set_packet_filter(struct rndis_device *dev, u32 new_filter)
 		 * send completion for it.
 		 */
 		goto exit;
-	} else {
-		set_complete = &request->response_msg.msg.set_complete;
-		status = set_complete->status;
-	}
+	} 
+
+	set_complete = &request->response_msg.msg.set_complete;
+	status = set_complete->status;
 
 cleanup:
 	if (request)