aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/can/mscan/mscan.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/can/mscan/mscan.c b/drivers/net/can/mscan/mscan.c
index 76e413e..20d1991 100644
--- a/drivers/net/can/mscan/mscan.c
+++ b/drivers/net/can/mscan/mscan.c
@@ -379,8 +379,10 @@ static int mscan_rx_poll(struct napi_struct *napi, int quota)
struct can_frame *frame;
u8 canrflg;
- while (npackets < quota && ((canrflg = in_8(&regs->canrflg)) &
- (MSCAN_RXF | MSCAN_ERR_IF))) {
+ while (npackets < quota) {
+ canrflg = in_8(&regs->canrflg);
+ if (!(canrflg & (MSCAN_RXF | MSCAN_ERR_IF)))
+ break;
skb = alloc_can_skb(dev, &frame);
if (!skb) {