Thread (2 messages) 2 messages, 2 authors, 2013-10-29

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

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.
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
[]
quoted hunk ↗ jump to hunk
@@ -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);

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help