diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2018-01-11 13:25:35 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2018-01-11 13:25:35 +0000 |
commit | a6383e99ffc3b615d8465aebbd5d48f1fa9b2949 (patch) | |
tree | 3a12abe3574d77aa3dd64bfdca88cbf806c5a0fe /hw/net | |
parent | 1fdde6537ecec4a6b416bc232c868b64d645cc62 (diff) | |
download | qemu-a6383e99ffc3b615d8465aebbd5d48f1fa9b2949.zip qemu-a6383e99ffc3b615d8465aebbd5d48f1fa9b2949.tar.gz qemu-a6383e99ffc3b615d8465aebbd5d48f1fa9b2949.tar.bz2 |
imx_fec: Refactor imx_eth_enable_rx()
Refactor imx_eth_enable_rx() to have more meaningfull variable name
than 'tmp' and to reduce number of logical negations done.
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
Cc: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org
Cc: yurovsky@gmail.com
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/net')
-rw-r--r-- | hw/net/imx_fec.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c index 88b4b04..8b2e4b8 100644 --- a/hw/net/imx_fec.c +++ b/hw/net/imx_fec.c @@ -536,19 +536,19 @@ static void imx_eth_do_tx(IMXFECState *s) static void imx_eth_enable_rx(IMXFECState *s) { IMXFECBufDesc bd; - bool tmp; + bool rx_ring_full; imx_fec_read_bd(&bd, s->rx_descriptor); - tmp = ((bd.flags & ENET_BD_E) != 0); + rx_ring_full = !(bd.flags & ENET_BD_E); - if (!tmp) { + if (rx_ring_full) { FEC_PRINTF("RX buffer full\n"); } else if (!s->regs[ENET_RDAR]) { qemu_flush_queued_packets(qemu_get_queue(s->nic)); } - s->regs[ENET_RDAR] = tmp ? ENET_RDAR_RDAR : 0; + s->regs[ENET_RDAR] = rx_ring_full ? 0 : ENET_RDAR_RDAR; } static void imx_eth_reset(DeviceState *d) |