[patch 12/12] can: c_can: Avoid led toggling for every packet.

From: Thomas Gleixner
Date: Tue Mar 18 2014 - 13:20:56 EST


There is no point to toggle the RX led for every packet. Especially if
we have a full FIFO we want to avoid everything we can.

Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
---
drivers/net/can/c_can/c_can.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

Index: linux/drivers/net/can/c_can/c_can.c
===================================================================
--- linux.orig/drivers/net/can/c_can/c_can.c
+++ linux/drivers/net/can/c_can/c_can.c
@@ -433,9 +433,6 @@ static int c_can_read_msg_object(struct

stats->rx_packets++;
stats->rx_bytes += frame->can_dlc;
-
- can_led_event(dev, CAN_LED_EVENT_RX);
-
return 0;
}

@@ -892,6 +889,10 @@ static int c_can_do_rx_poll(struct net_d
pkts += n;
quota -= n;
}
+
+ if (pkts)
+ can_led_event(dev, CAN_LED_EVENT_RX);
+
return pkts;
}



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/