Skip to contentSkip to conversation

VSOCK: fix returnvar.cocci warnings

PATCH Applied Julia Lawall 3 participants 4 messages Dec 6, 2015 – Dec 7, 2015

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 VSOCK: fix returnvar.cocci warnings

Remove unneeded variable used to store return value.

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

---

 vsock.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/vhost/vsock.c +1 -2
@@ -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)
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Julia Lawall

Remove unneeded variable used to store return value.

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

---

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

drivers/vhost/vsock.c struct vhost_vsock { · line 62

Quoted 9 lines
drivers/vhost/vsock.c +1 -2
@@ -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)

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization