diff options
author | Jarno Rajahalme <jarno@ovn.org> | 2016-11-19 00:40:38 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-19 16:37:03 +0100 |
commit | 3e9e40e74753346218e8285cf1ecff9ef3a624c6 (patch) | |
tree | efc76c91903ebe831f20503ede23baebfc447222 /drivers/net/macvtap.c | |
parent | cxgb4: Allocate Tx queues dynamically (diff) | |
download | linux-3e9e40e74753346218e8285cf1ecff9ef3a624c6.tar.xz linux-3e9e40e74753346218e8285cf1ecff9ef3a624c6.zip |
virtio_net: Simplify call sites for virtio_net_hdr_{from, to}_skb().
No point storing the return value of virtio_net_hdr_to_skb() or
virtio_net_hdr_from_skb() to a variable when the value is used only
once as a boolean in an immediately following if statement.
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/macvtap.c')
-rw-r--r-- | drivers/net/macvtap.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c index 070e3290aa6e..5da9861ad79c 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c @@ -821,9 +821,8 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q, if (iov_iter_count(iter) < vnet_hdr_len) return -EINVAL; - ret = virtio_net_hdr_from_skb(skb, &vnet_hdr, - macvtap_is_little_endian(q)); - if (ret) + if (virtio_net_hdr_from_skb(skb, &vnet_hdr, + macvtap_is_little_endian(q))) BUG(); if (copy_to_iter(&vnet_hdr, sizeof(vnet_hdr), iter) != |