diff options
author | Stephane Grosjean <s.grosjean@peak-system.com> | 2012-03-07 09:31:30 -0500 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2012-03-07 09:51:01 -0500 |
commit | 1ccba2103a8b3a1041f261301b08b9e16f76df8a (patch) | |
tree | 4175fcc3a863d8f4f94873ff11bf32dc414f4478 /drivers/net/can/usb | |
parent | ae5d33723e325392c48bc0ff481d9ec8d646a0ed (diff) |
can: peak_usb: PCAN-USB specific part: fix little endian usage
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@oracle.com>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/usb')
-rw-r--r-- | 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 8a7982e18e4e..86f26a1ede4c 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, | |||
741 | 741 | ||
742 | /* can id */ | 742 | /* can id */ |
743 | if (cf->can_id & CAN_EFF_FLAG) { | 743 | if (cf->can_id & CAN_EFF_FLAG) { |
744 | __le32 tmp32 = cpu_to_le32(cf->can_id & CAN_ERR_MASK); | 744 | __le32 tmp32 = cpu_to_le32((cf->can_id & CAN_ERR_MASK) << 3); |
745 | 745 | ||
746 | tmp32 <<= 3; | ||
747 | *pc |= PCAN_USB_STATUSLEN_EXT_ID; | 746 | *pc |= PCAN_USB_STATUSLEN_EXT_ID; |
748 | memcpy(++pc, &tmp32, 4); | 747 | memcpy(++pc, &tmp32, 4); |
749 | pc += 4; | 748 | pc += 4; |
750 | } else { | 749 | } else { |
751 | __le16 tmp16 = cpu_to_le32(cf->can_id & CAN_ERR_MASK); | 750 | __le16 tmp16 = cpu_to_le16((cf->can_id & CAN_ERR_MASK) << 5); |
752 | 751 | ||
753 | tmp16 <<= 5; | ||
754 | memcpy(++pc, &tmp16, 2); | 752 | memcpy(++pc, &tmp16, 2); |
755 | pc += 2; | 753 | pc += 2; |
756 | } | 754 | } |