diff options
author | Ahmed S. Darwish <ahmed.darwish@valeo.com> | 2015-03-15 11:10:49 -0400 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2015-03-22 13:14:50 -0400 |
commit | 7e184c28636dce594426cd7d8781d52d1dd447cd (patch) | |
tree | 5f15c918647b3a747ef75fc4958df18f61d8e34f | |
parent | 082d70b6142f623c10f7a032d9b63a2399fb4ded (diff) |
can: kvaser_usb: Fix sparse warning __le16 degrades to integer
USB endpoint's wMaxPacketSize field is an le16 entity. Use
appropriate le16_to_cpu macros to maintain endian independence.
Reported-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Ahmed S. Darwish <ahmed.darwish@valeo.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rw-r--r-- | drivers/net/can/usb/kvaser_usb.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/can/usb/kvaser_usb.c b/drivers/net/can/usb/kvaser_usb.c index 2f9733a8e125..57611fd91229 100644 --- a/drivers/net/can/usb/kvaser_usb.c +++ b/drivers/net/can/usb/kvaser_usb.c | |||
@@ -596,8 +596,8 @@ static int kvaser_usb_wait_msg(const struct kvaser_usb *dev, u8 id, | |||
596 | * for further details. | 596 | * for further details. |
597 | */ | 597 | */ |
598 | if (tmp->len == 0) { | 598 | if (tmp->len == 0) { |
599 | pos = round_up(pos, | 599 | pos = round_up(pos, le16_to_cpu(dev->bulk_in-> |
600 | dev->bulk_in->wMaxPacketSize); | 600 | wMaxPacketSize)); |
601 | continue; | 601 | continue; |
602 | } | 602 | } |
603 | 603 | ||
@@ -1337,7 +1337,8 @@ static void kvaser_usb_read_bulk_callback(struct urb *urb) | |||
1337 | * number of events in case of a heavy rx load on the bus. | 1337 | * number of events in case of a heavy rx load on the bus. |
1338 | */ | 1338 | */ |
1339 | if (msg->len == 0) { | 1339 | if (msg->len == 0) { |
1340 | pos = round_up(pos, dev->bulk_in->wMaxPacketSize); | 1340 | pos = round_up(pos, le16_to_cpu(dev->bulk_in-> |
1341 | wMaxPacketSize)); | ||
1341 | continue; | 1342 | continue; |
1342 | } | 1343 | } |
1343 | 1344 | ||