Skip to contentSkip to conversation

vhost: remove unneeded variable assignment

PATCH In review Emmanuel Roullit 2 participants 2 messages Jan 24, 2017 – Jan 30, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vhost: remove unneeded variable assignment

Found with clang static analysis:
lib/librte_vhost/vhost_user.c:996:3: warning:
Value stored to 'ret' is never read

        ret = vhost_user_get_vring_base(dev, &msg.payload.state);
        ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes 73c8f9f69c6c ("vhost: introduce reply ack feature")
---
 lib/librte_vhost/vhost_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_vhost/vhost_user.c +1 -1
index 7343a00a1..3391d5ea5 100644
@@ -995,7 +995,7 @@ vhost_user_msg_handler(int vid, int fd)
 		break;
 
 	case VHOST_USER_GET_VRING_BASE:
-		ret = vhost_user_get_vring_base(dev, &msg.payload.state);
+		vhost_user_get_vring_base(dev, &msg.payload.state);
 		msg.size = sizeof(msg.payload.state);
 		send_vhost_message(fd, &msg);
 		break;
Signature · 1 line
2.11.0
#1 lore raw
Quoted 7 lines · Emmanuel Roullit

Found with clang static analysis:
lib/librte_vhost/vhost_user.c:996:3: warning:
Value stored to 'ret' is never read

        ret = vhost_user_get_vring_base(dev, &msg.payload.state);
        ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes 73c8f9f69c6c ("vhost: introduce reply ack feature")

Again, you were referencing the bad commit. For this case, I'd like to remove such fixline, as this patch doesn't really "fix" anything. But since you made it, I could apply it.

So applied to dpdk-next-virtio.

	--yliu