diff mbox

VSOCK: fix returnvar.cocci warnings

Message ID alpine.DEB.2.02.1512060654580.2030@localhost6.localdomain6
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Julia Lawall Dec. 6, 2015, 5:56 a.m. UTC
Remove unneeded variable used to store return value.

Generated by: scripts/coccinelle/misc/returnvar.cocci

CC: Asias He <asias@redhat.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>

---

 vsock.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--
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

Comments

Stefan Hajnoczi Dec. 7, 2015, 1:50 a.m. UTC | #1
On Sun, Dec 06, 2015 at 06:56:23AM +0100, Julia Lawall wrote:
> Remove unneeded variable used to store return value.
> 
> Generated by: scripts/coccinelle/misc/returnvar.cocci
> 
> CC: Asias He <asias@redhat.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
> 
> ---
> 
>  vsock.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> --- a/drivers/vhost/vsock.c
> +++ b/drivers/vhost/vsock.c
> @@ -56,8 +56,7 @@ struct vhost_vsock {
>  
>  static u32 vhost_transport_get_local_cid(void)
>  {
> -	u32 cid = VHOST_VSOCK_DEFAULT_HOST_CID;
> -	return cid;
> +	return VHOST_VSOCK_DEFAULT_HOST_CID;
>  }
>  
>  static struct vhost_vsock *vhost_vsock_get(u32 guest_cid)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
David Miller Dec. 7, 2015, 3:38 a.m. UTC | #2
From: Julia Lawall <julia.lawall@lip6.fr>
Date: Sun, 6 Dec 2015 06:56:23 +0100 (CET)

> Remove unneeded variable used to store return value.
> 
> Generated by: scripts/coccinelle/misc/returnvar.cocci
> 
> CC: Asias He <asias@redhat.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>

Applied to net-next, thanks.
--
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

--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -56,8 +56,7 @@  struct vhost_vsock {
 
 static u32 vhost_transport_get_local_cid(void)
 {
-	u32 cid = VHOST_VSOCK_DEFAULT_HOST_CID;
-	return cid;
+	return VHOST_VSOCK_DEFAULT_HOST_CID;
 }
 
 static struct vhost_vsock *vhost_vsock_get(u32 guest_cid)