virtio-net: remove unused skb_vnet_hdr->num_sg field
authorMichael S. Tsirkin <mst@redhat.com>
Tue, 16 Oct 2012 13:26:14 +0000 (23:56 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 18 Dec 2012 04:50:32 +0000 (15:20 +1030)
[Split from "correct capacity math on ring full" -- Rusty]

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
drivers/net/virtio_net.c

index 3db65867895be0e9fad6de1fe8ff1f8e46c8e134..6c094c88424efc7260a9dfc5e0ed522784a8f848 100644 (file)
@@ -95,7 +95,6 @@ struct skb_vnet_hdr {
                struct virtio_net_hdr hdr;
                struct virtio_net_hdr_mrg_rxbuf mhdr;
        };
-       unsigned int num_sg;
 };
 
 struct padded_vnet_hdr {
@@ -579,6 +578,7 @@ static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb)
 {
        struct skb_vnet_hdr *hdr = skb_vnet_hdr(skb);
        const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest;
+       unsigned num_sg;
 
        pr_debug("%s: xmit %p %pM\n", vi->dev->name, skb, dest);
 
@@ -617,8 +617,8 @@ static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb)
        else
                sg_set_buf(vi->tx_sg, &hdr->hdr, sizeof hdr->hdr);
 
-       hdr->num_sg = skb_to_sgvec(skb, vi->tx_sg + 1, 0, skb->len) + 1;
-       return virtqueue_add_buf(vi->svq, vi->tx_sg, hdr->num_sg,
+       num_sg = skb_to_sgvec(skb, vi->tx_sg + 1, 0, skb->len) + 1;
+       return virtqueue_add_buf(vi->svq, vi->tx_sg, num_sg,
                                 0, skb, GFP_ATOMIC);
 }