[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1293296117-27624-10-git-send-email-mkl@pengutronix.de>
Date: Sat, 25 Dec 2010 17:55:17 +0100
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: netdev@...r.kernel.org
Cc: socketcan-core@...ts.berlios.de,
Marc Kleine-Budde <mkl@...gutronix.de>,
Tomoya <tomoya-linux@....okisemi.com>
Subject: [PATCH v2 9/9] can: pch_can: don't copy data to rx'ed RTR frames
Signed-off-by: Marc Kleine-Budde <mkl@...gutronix.de>
Cc: Tomoya <tomoya-linux@....okisemi.com>
Signed-off-by: Marc Kleine-Budde <mkl@...gutronix.de>
---
Changes since v1:
- fix data copy: copy if rtr is _not_ set (thanks Oliver)
drivers/net/can/pch_can.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c
index c42e972..cd6b27d 100644
--- a/drivers/net/can/pch_can.c
+++ b/drivers/net/can/pch_can.c
@@ -692,16 +692,17 @@ static int pch_can_rx_normal(struct net_device *ndev, u32 obj_num, int quota)
cf->can_id = id;
}
- if (id2 & PCH_ID2_DIR)
- cf->can_id |= CAN_RTR_FLAG;
-
cf->can_dlc = get_can_dlc((ioread32(&priv->regs->
ifregs[0].mcont)) & 0xF);
- for (i = 0; i < cf->can_dlc; i += 2) {
- data_reg = ioread16(&priv->regs->ifregs[0].data[i / 2]);
- cf->data[i] = data_reg;
- cf->data[i + 1] = data_reg >> 8;
+ if (id2 & PCH_ID2_DIR)
+ cf->can_id |= CAN_RTR_FLAG;
+ else {
+ for (i = 0; i < cf->can_dlc; i += 2) {
+ data_reg = ioread16(&priv->regs->ifregs[0].data[i / 2]);
+ cf->data[i] = data_reg;
+ cf->data[i + 1] = data_reg >> 8;
+ }
}
netif_receive_skb(skb);
--
1.7.2.3
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists