[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1331200230-1118-2-git-send-email-mkl@pengutronix.de>
Date: Thu, 8 Mar 2012 10:50:30 +0100
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, linux-can@...r.kernel.org,
kernel@...gutronix.de,
Stephane Grosjean <s.grosjean@...k-system.com>,
Marc Kleine-Budde <mkl@...gutronix.de>
Subject: [PATCH] can: peak_usb: PCAN-USB specific part: fix little endian usage
From: Stephane Grosjean <s.grosjean@...k-system.com>
That patch fixes some bad usage of two little-endian variables, which lead to
some warning/error when building the peak_usb driver.
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
Acked-by: Marc Kleine-Budde <mkl@...gutronix.de>
Signed-off-by: Stephane Grosjean <s.grosjean@...k-system.com>
Signed-off-by: Marc Kleine-Budde <mkl@...gutronix.de>
---
drivers/net/can/usb/peak_usb/pcan_usb.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb.c b/drivers/net/can/usb/peak_usb/pcan_usb.c
index 8a7982e..86f26a1 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb.c
@@ -741,16 +741,14 @@ static int pcan_usb_encode_msg(struct peak_usb_device *dev, struct sk_buff *skb,
/* can id */
if (cf->can_id & CAN_EFF_FLAG) {
- __le32 tmp32 = cpu_to_le32(cf->can_id & CAN_ERR_MASK);
+ __le32 tmp32 = cpu_to_le32((cf->can_id & CAN_ERR_MASK) << 3);
- tmp32 <<= 3;
*pc |= PCAN_USB_STATUSLEN_EXT_ID;
memcpy(++pc, &tmp32, 4);
pc += 4;
} else {
- __le16 tmp16 = cpu_to_le32(cf->can_id & CAN_ERR_MASK);
+ __le16 tmp16 = cpu_to_le16((cf->can_id & CAN_ERR_MASK) << 5);
- tmp16 <<= 5;
memcpy(++pc, &tmp16, 2);
pc += 2;
}
--
1.7.4.1
--
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