diff options
author | Philippe Mathieu-Daudé <philmd@redhat.com> | 2020-03-05 18:56:49 +0100 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2020-03-31 21:14:35 +0800 |
commit | b8c4b67e3ec3918a40234e5c56221f780c7856fc (patch) | |
tree | 1ca475ca3fe280e0f857cfe1160b52753b53bd72 /hw/net/cadence_gem.c | |
parent | 3317db743972f665e2753c75703538d51241350a (diff) |
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/cadence_gem.c')
-rw-r--r-- | hw/net/cadence_gem.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c index 6340c1eaf8..51ec5a072d 100644 --- a/hw/net/cadence_gem.c +++ b/hw/net/cadence_gem.c @@ -505,7 +505,7 @@ static void phy_update_link(CadenceGEMState *s) } } -static int gem_can_receive(NetClientState *nc) +static bool gem_can_receive(NetClientState *nc) { CadenceGEMState *s; int i; @@ -518,7 +518,7 @@ static int gem_can_receive(NetClientState *nc) s->can_rx_state = 1; DB_PRINT("can't receive - no enable\n"); } - return 0; + return false; } for (i = 0; i < s->num_priority_queues; i++) { @@ -532,14 +532,14 @@ static int gem_can_receive(NetClientState *nc) s->can_rx_state = 2; DB_PRINT("can't receive - all the buffer descriptors are busy\n"); } - return 0; + return false; } if (s->can_rx_state != 0) { s->can_rx_state = 0; DB_PRINT("can receive\n"); } - return 1; + return true; } /* |