Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e184c28 authored by Ahmed S. Darwish's avatar Ahmed S. Darwish Committed by Marc Kleine-Budde
Browse files

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: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: default avatarAhmed S. Darwish <ahmed.darwish@valeo.com>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 082d70b6
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -596,8 +596,8 @@ static int kvaser_usb_wait_msg(const struct kvaser_usb *dev, u8 id,
			 * for further details.
			 */
			if (tmp->len == 0) {
				pos = round_up(pos,
					       dev->bulk_in->wMaxPacketSize);
				pos = round_up(pos, le16_to_cpu(dev->bulk_in->
								wMaxPacketSize));
				continue;
			}

@@ -1337,7 +1337,8 @@ static void kvaser_usb_read_bulk_callback(struct urb *urb)
		 * number of events in case of a heavy rx load on the bus.
		 */
		if (msg->len == 0) {
			pos = round_up(pos, dev->bulk_in->wMaxPacketSize);
			pos = round_up(pos, le16_to_cpu(dev->bulk_in->
							wMaxPacketSize));
			continue;
		}