summary refs log tree commit diff stats
path: root/hw/net/sungem.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2020-03-05 18:56:49 +0100
committerJason Wang <jasowang@redhat.com>2020-03-31 21:14:35 +0800
commitb8c4b67e3ec3918a40234e5c56221f780c7856fc (patch)
tree1ca475ca3fe280e0f857cfe1160b52753b53bd72 /hw/net/sungem.c
parent3317db743972f665e2753c75703538d51241350a (diff)
downloadfocaccia-qemu-b8c4b67e3ec3918a40234e5c56221f780c7856fc.tar.gz
focaccia-qemu-b8c4b67e3ec3918a40234e5c56221f780c7856fc.zip
hw/net: Make NetCanReceive() return a boolean
The NetCanReceive handler return whether the device can or
can not receive new packets. Make it obvious by returning
a boolean type.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'hw/net/sungem.c')
-rw-r--r--hw/net/sungem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/net/sungem.c b/hw/net/sungem.c
index 89da51f7f6..b01197d952 100644
--- a/hw/net/sungem.c
+++ b/hw/net/sungem.c
@@ -433,7 +433,7 @@ static bool sungem_rx_full(SunGEMState *s, uint32_t kick, uint32_t done)
     return kick == ((done + 1) & s->rx_mask);
 }
 
-static int sungem_can_receive(NetClientState *nc)
+static bool sungem_can_receive(NetClientState *nc)
 {
     SunGEMState *s = qemu_get_nic_opaque(nc);
     uint32_t kick, done, rxdma_cfg, rxmac_cfg;
@@ -445,11 +445,11 @@ static int sungem_can_receive(NetClientState *nc)
     /* If MAC disabled, can't receive */
     if ((rxmac_cfg & MAC_RXCFG_ENAB) == 0) {
         trace_sungem_rx_mac_disabled();
-        return 0;
+        return false;
     }
     if ((rxdma_cfg & RXDMA_CFG_ENABLE) == 0) {
         trace_sungem_rx_txdma_disabled();
-        return 0;
+        return false;
     }
 
     /* Check RX availability */