Patchwork [2/6] virtio: net: remove dead assignment

login
register
mail settings
Submitter Amit Shah
Date Jan. 13, 2010, 10:54 a.m.
Message ID <1263380087-31821-3-git-send-email-amit.shah@redhat.com>
Download mbox | patch
Permalink /patch/42803/
State New
Headers show

Comments

Amit Shah - Jan. 13, 2010, 10:54 a.m.
clang-analyzer points out value assigned to 'len' is not used.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
 hw/virtio-net.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Michael S. Tsirkin - Jan. 13, 2010, 8:51 p.m.
On Wed, Jan 13, 2010 at 04:24:43PM +0530, Amit Shah wrote:
> clang-analyzer points out value assigned to 'len' is not used.
> 
> Signed-off-by: Amit Shah <amit.shah@redhat.com>

Acked-by: Michael S. Tsirkin <mst@redhat.com>

> ---
>  hw/virtio-net.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/virtio-net.c b/hw/virtio-net.c
> index 02d9180..6e48997 100644
> --- a/hw/virtio-net.c
> +++ b/hw/virtio-net.c
> @@ -532,7 +532,7 @@ static ssize_t virtio_net_receive(VLANClientState *nc, const uint8_t *buf, size_
>          int len, total;
>          struct iovec sg[VIRTQUEUE_MAX_SIZE];
>  
> -        len = total = 0;
> +        total = 0;
>  
>          if ((i != 0 && !n->mergeable_rx_bufs) ||
>              virtqueue_pop(n->rx_vq, &elem) == 0) {
> -- 
> 1.6.2.5
> 
>

Patch

diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index 02d9180..6e48997 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -532,7 +532,7 @@  static ssize_t virtio_net_receive(VLANClientState *nc, const uint8_t *buf, size_
         int len, total;
         struct iovec sg[VIRTQUEUE_MAX_SIZE];
 
-        len = total = 0;
+        total = 0;
 
         if ((i != 0 && !n->mergeable_rx_bufs) ||
             virtqueue_pop(n->rx_vq, &elem) == 0) {