Re: [PATCH v2] can: c_can: Speed up rx_poll function
From: Joe Perches <joe@perches.com>
Date: 2013-10-29 08:31:10
Also in:
linux-can, lkml
From: Joe Perches <joe@perches.com>
Date: 2013-10-29 08:31:10
Also in:
linux-can, lkml
On Tue, 2013-10-29 at 09:27 +0100, Markus Pargmann wrote:
This patch speeds up the rx_poll function by reducing the number of register reads.
[]
The third change is to replace the for-loop by a find_next_bit loop.
You need to update the commit message.
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
[]
@@ -798,17 +798,19 @@ static int c_can_do_rx_poll(struct net_device *dev, int quota)
[]
+ while (quota > 0 && (val = priv->read_reg(priv, C_CAN_INTPND1_REG))) {
+ while ((msg_obj = ffs(val)) && quota > 0) {
+ val &= ~BIT(msg_obj - 1);