qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v1 53/59] net/net_tx_pkt.c: remove unneeded label in net_tx_pkt_g


From: Daniel Henrique Barboza
Subject: [PATCH v1 53/59] net/net_tx_pkt.c: remove unneeded label in net_tx_pkt_get_gso_type()
Date: Mon, 6 Jan 2020 15:24:19 -0300

'func_exit' can be replaced by 'return' with the appropriate
return value. 'rc' also becomes unnecessary after this change,
thus let's remove it as well.

CC: Dmitry Fleytman <address@hidden>
Signed-off-by: Daniel Henrique Barboza <address@hidden>
---
 hw/net/net_tx_pkt.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c
index 162f802dd7..3cd6aa1d0e 100644
--- a/hw/net/net_tx_pkt.c
+++ b/hw/net/net_tx_pkt.c
@@ -287,21 +287,18 @@ struct virtio_net_hdr *net_tx_pkt_get_vhdr(struct 
NetTxPkt *pkt)
 static uint8_t net_tx_pkt_get_gso_type(struct NetTxPkt *pkt,
                                           bool tso_enable)
 {
-    uint8_t rc = VIRTIO_NET_HDR_GSO_NONE;
     uint16_t l3_proto;
 
     l3_proto = eth_get_l3_proto(&pkt->vec[NET_TX_PKT_L2HDR_FRAG], 1,
         pkt->vec[NET_TX_PKT_L2HDR_FRAG].iov_len);
 
     if (!tso_enable) {
-        goto func_exit;
+        return VIRTIO_NET_HDR_GSO_NONE;
     }
 
-    rc = eth_get_gso_type(l3_proto, pkt->vec[NET_TX_PKT_L3HDR_FRAG].iov_base,
-                          pkt->l4proto);
-
-func_exit:
-    return rc;
+    return eth_get_gso_type(l3_proto,
+                            pkt->vec[NET_TX_PKT_L3HDR_FRAG].iov_base,
+                            pkt->l4proto);
 }
 
 void net_tx_pkt_build_vheader(struct NetTxPkt *pkt, bool tso_enable,
-- 
2.24.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]