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

Commit dd04dc6d authored by Martin Kepplinger's avatar Martin Kepplinger Committed by Dmitry Torokhov
Browse files

Input: sur40 - fix bad endianness handling in sur40_poll



sparse says:

  sur40.c:372:40: warning: restricted __le32 degrades to integer

the header's data is __le32 so we need to convert it before comparing.

Signed-off-by: default avatarMartin Kepplinger <martink@posteo.de>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent d99caa47
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -369,7 +369,7 @@ static void sur40_poll(struct input_polled_dev *polldev)
		 * packet ID will usually increase in the middle of a series
		 * packet ID will usually increase in the middle of a series
		 * instead of at the end.
		 * instead of at the end.
		 */
		 */
		if (packet_id != header->packet_id)
		if (packet_id != le32_to_cpu(header->packet_id))
			dev_dbg(sur40->dev, "packet ID mismatch\n");
			dev_dbg(sur40->dev, "packet ID mismatch\n");


		packet_blobs = result / sizeof(struct sur40_blob);
		packet_blobs = result / sizeof(struct sur40_blob);