Commit 359d44d7 authored by Zhi Yong Wu's avatar Zhi Yong Wu Committed by David S. Miller

macvtap: remove the dead branch

Signed-off-by: default avatarZhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 59566b6e
...@@ -588,7 +588,7 @@ static int macvtap_skb_from_vnet_hdr(struct sk_buff *skb, ...@@ -588,7 +588,7 @@ static int macvtap_skb_from_vnet_hdr(struct sk_buff *skb,
return 0; return 0;
} }
static int macvtap_skb_to_vnet_hdr(const struct sk_buff *skb, static void macvtap_skb_to_vnet_hdr(const struct sk_buff *skb,
struct virtio_net_hdr *vnet_hdr) struct virtio_net_hdr *vnet_hdr)
{ {
memset(vnet_hdr, 0, sizeof(*vnet_hdr)); memset(vnet_hdr, 0, sizeof(*vnet_hdr));
...@@ -619,8 +619,6 @@ static int macvtap_skb_to_vnet_hdr(const struct sk_buff *skb, ...@@ -619,8 +619,6 @@ static int macvtap_skb_to_vnet_hdr(const struct sk_buff *skb,
} else if (skb->ip_summed == CHECKSUM_UNNECESSARY) { } else if (skb->ip_summed == CHECKSUM_UNNECESSARY) {
vnet_hdr->flags = VIRTIO_NET_HDR_F_DATA_VALID; vnet_hdr->flags = VIRTIO_NET_HDR_F_DATA_VALID;
} /* else everything is zero */ } /* else everything is zero */
return 0;
} }
/* Get packet from user space buffer */ /* Get packet from user space buffer */
...@@ -778,9 +776,7 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q, ...@@ -778,9 +776,7 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,
if ((len -= vnet_hdr_len) < 0) if ((len -= vnet_hdr_len) < 0)
return -EINVAL; return -EINVAL;
ret = macvtap_skb_to_vnet_hdr(skb, &vnet_hdr); macvtap_skb_to_vnet_hdr(skb, &vnet_hdr);
if (ret)
return ret;
if (memcpy_toiovecend(iv, (void *)&vnet_hdr, 0, sizeof(vnet_hdr))) if (memcpy_toiovecend(iv, (void *)&vnet_hdr, 0, sizeof(vnet_hdr)))
return -EFAULT; return -EFAULT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment