From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: qemu-arm@nongnu.org
Cc: "Andrey Smirnov" <andrew.smirnov@gmail.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Jason Wang" <jasowang@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
qemu-devel@nongnu.org, yurovsky@gmail.com
Subject: [Qemu-devel] [PATCH v2 02/27] imx_fec: Refactor imx_eth_enable_rx()
Date: Mon, 23 Oct 2017 13:10:30 -0700 [thread overview]
Message-ID: <20171023201055.21973-3-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <20171023201055.21973-1-andrew.smirnov@gmail.com>
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: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
hw/net/imx_fec.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c
index 88b4b049d7..8b2e4b8ffe 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)
--
2.13.5
next prev parent reply other threads:[~2017-10-23 20:11 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-23 20:10 [Qemu-devel] [PATCH v2 00/27] Initial i.MX7 support Andrey Smirnov
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 01/27] imx_fec: Do not link to netdev Andrey Smirnov
2017-10-23 20:10 ` Andrey Smirnov [this message]
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 03/27] imx_fec: Change queue flushing heuristics Andrey Smirnov
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 04/27] imx_fec: Use ENET_FTRL to determine truncation length Andrey Smirnov
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 05/27] imx_fec: Use MIN instead of explicit ternary operator Andrey Smirnov
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 06/27] imx_fec: Emulate SHIFT16 in ENETx_RACC Andrey Smirnov
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 07/27] imx_fec: Add support for multiple Tx DMA rings Andrey Smirnov
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 08/27] imx_fec: Use correct length for packet size Andrey Smirnov
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 09/27] imx_fec: Fix a typo in imx_enet_receive() Andrey Smirnov
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 10/27] imx_fec: Reserve full 4K page for the register file Andrey Smirnov
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 11/27] sdhci: Add i.MX specific subtype of SDHCI Andrey Smirnov
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 12/27] sdhci: Implement write method of ACMD12ERRSTS register Andrey Smirnov
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 13/27] i.MX: Add code to emulate i.MX7 CCM, PMU and ANALOG IP blocks Andrey Smirnov
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 14/27] i.MX: Add code to emulate i.MX2 watchdog IP block Andrey Smirnov
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 15/27] i.MX: Add code to emulate i.MX7 SNVS IP-block Andrey Smirnov
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 16/27] i.MX: Add code to emulate GPCv2 IP block Andrey Smirnov
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 17/27] i.MX: Add code to emulate i.MX7 IOMUXC " Andrey Smirnov
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 19/27] i.MX: Add code to emulate SDMA " Andrey Smirnov
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 20/27] i.MX: Add code to emulate FlexCAN " Andrey Smirnov
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 21/27] i.MX: Add implementation of i.MX7 GPR " Andrey Smirnov
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 22/27] pci: Add support for Designware " Andrey Smirnov
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 23/27] i.MX: Add code to emulate i.MX7 USBMISC " Andrey Smirnov
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 24/27] i.MX: Add code to emulate i.MX7 ADC " Andrey Smirnov
2017-10-23 20:10 ` [Qemu-devel] [PATCH v2 26/27] i.MX: Add i.MX7 SOC implementation Andrey Smirnov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171023201055.21973-3-andrew.smirnov@gmail.com \
--to=andrew.smirnov@gmail.com \
--cc=f4bug@amsat.org \
--cc=jasowang@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=yurovsky@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).