summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-11-14 10:53:21 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-11-14 13:56:35 +0100
commitc968b95ab21470e54e2b70adc8cc9dd957665f02 (patch)
tree162cf433dc8e35402ba5c7ab344c0e7fdedbd60e /drivers/net
parent2559b6a993b86c25dc5823933b69cc814d7797bd (diff)
downloadbarebox-c968b95ab21470e54e2b70adc8cc9dd957665f02.tar.gz
net: fsl-fman: move status read into loop
Instead of reading the status once before the loop and then again right before the next iteration, just read the status in the loop. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/fsl-fman.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/fsl-fman.c b/drivers/net/fsl-fman.c
index b5d6172..5dc7ed5 100644
--- a/drivers/net/fsl-fman.c
+++ b/drivers/net/fsl-fman.c
@@ -900,9 +900,12 @@ static int fm_eth_recv(struct eth_device *edev)
pram = fm_eth->rx_pram;
rxbd = fm_eth->cur_rxbd;
- status = muram_readw(&rxbd->status);
- while (!(status & RxBD_EMPTY)) {
+ while (1) {
+ status = muram_readw(&rxbd->status);
+ if (status & RxBD_EMPTY)
+ break;
+
if (!(status & RxBD_ERROR)) {
buf_hi = muram_readw(&rxbd->buf_ptr_hi);
buf_lo = in_be32(&rxbd->buf_ptr_lo);
@@ -932,8 +935,6 @@ static int fm_eth_recv(struct eth_device *edev)
rxbd_base = fm_eth->rx_bd_ring;
if (rxbd >= (rxbd_base + RX_BD_RING_SIZE))
rxbd = rxbd_base;
- /* read next status */
- status = muram_readw(&rxbd->status);
/* update RxQD */
offset_out = muram_readw(&pram->rxqd.offset_out);