From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: socketcan-core@lists.berlios.de,
Marc Kleine-Budde <mkl@pengutronix.de>,
Barry Song <21cnbao@gmail.com>
Subject: [PATCH 2/9] can: bfin_can: don't copy data to rx'ed RTR frames
Date: Sat, 25 Dec 2010 15:40:27 +0100 [thread overview]
Message-ID: <1293288034-22428-3-git-send-email-mkl@pengutronix.de> (raw)
In-Reply-To: <1293288034-22428-1-git-send-email-mkl@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Barry Song <21cnbao@gmail.com>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
---
drivers/net/can/bfin_can.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/net/can/bfin_can.c b/drivers/net/can/bfin_can.c
index b6e890d..07222ca 100644
--- a/drivers/net/can/bfin_can.c
+++ b/drivers/net/can/bfin_can.c
@@ -306,18 +306,19 @@ static void bfin_can_rx(struct net_device *dev, u16 isrc)
& 0x1ffc) >> 2;
obj = RECEIVE_STD_CHL;
}
- if (bfin_read16(®->chl[obj].id1) & RTR)
- cf->can_id |= CAN_RTR_FLAG;
/* get data length code */
cf->can_dlc = get_can_dlc(bfin_read16(®->chl[obj].dlc) & 0xF);
- /* get payload */
- for (i = 0; i < 8; i += 2) {
- val = bfin_read16(®->chl[obj].data[i]);
- cf->data[7 - i] = (7 - i) < cf->can_dlc ? val : 0;
- cf->data[6 - i] = (6 - i) < cf->can_dlc ? (val >> 8) : 0;
- }
+ if (bfin_read16(®->chl[obj].id1) & RTR)
+ cf->can_id |= CAN_RTR_FLAG;
+ else /* get payload */
+ for (i = 0; i < 8; i += 2) {
+ val = bfin_read16(®->chl[obj].data[i]);
+ cf->data[7 - i] = (7 - i) < cf->can_dlc ? val : 0;
+ cf->data[6 - i] = (6 - i) < cf->can_dlc ?
+ (val >> 8) : 0;
+ }
netif_rx(skb);
--
1.7.2.3
next prev parent reply other threads:[~2010-12-25 14:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-25 14:40 [PATCH 0/9] can: don't copy data to rx'ed RTR frames Marc Kleine-Budde
2010-12-25 14:40 ` Marc Kleine-Budde [this message]
[not found] ` <1293288034-22428-1-git-send-email-mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-12-25 14:40 ` [PATCH 1/9] can: at91_can: " Marc Kleine-Budde
2010-12-25 14:40 ` [PATCH 3/9] can: flexcan: " Marc Kleine-Budde
2010-12-25 14:40 ` [PATCH 6/9] can: ti_hecc: " Marc Kleine-Budde
2010-12-25 14:40 ` [PATCH 4/9] can: sja1000: " Marc Kleine-Budde
2010-12-25 14:40 ` [PATCH 5/9] can: mcp251x: " Marc Kleine-Budde
2010-12-25 14:40 ` [PATCH 7/9] can: janz-ican3: cleanup of ican3_to_can_frame and can_frame_to_ican3 Marc Kleine-Budde
[not found] ` <1293288034-22428-8-git-send-email-mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-12-26 3:32 ` David Miller
2010-12-25 14:40 ` [PATCH 8/9] can: janz-ican3: don't copy data to rx'ed RTR frames Marc Kleine-Budde
2010-12-25 14:40 ` [PATCH 9/9] can: pch_can: " Marc Kleine-Budde
[not found] ` <1293288034-22428-10-git-send-email-mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-12-25 15:52 ` Oliver Hartkopp
[not found] ` <4D161334.3090100-fJ+pQTUTwRTk1uMJSBkQmQ@public.gmane.org>
2010-12-25 16:25 ` Marc Kleine-Budde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1293288034-22428-3-git-send-email-mkl@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=21cnbao@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=socketcan-core@lists.berlios.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).