mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Martin Kepplinger <martink@posteo.de>
To: dmitry.torokhov@gmail.com
Cc: hverkuil@xs4all.nl, mchehab@kernel.org,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Martin Kepplinger <martink@posteo.de>
Subject: [PATCH] input: touchscreen: sur40: fix bad endianness handling in sur40_poll
Date: Tue,  4 Apr 2017 15:06:17 +0200	[thread overview]
Message-ID: <1491311177-16974-1-git-send-email-martink@posteo.de> (raw)

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: Martin Kepplinger <martink@posteo.de>
---
 drivers/input/touchscreen/sur40.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c
index 4c0eeca..128e5bd 100644
--- a/drivers/input/touchscreen/sur40.c
+++ b/drivers/input/touchscreen/sur40.c
@@ -369,7 +369,7 @@ static void sur40_poll(struct input_polled_dev *polldev)
 		 * packet ID will usually increase in the middle of a series
 		 * 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");
 
 		packet_blobs = result / sizeof(struct sur40_blob);
-- 
2.1.4

             reply	other threads:[~2017-04-04 13:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-04 13:06 Martin Kepplinger [this message]
2017-04-04 17:07 ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1491311177-16974-1-git-send-email-martink@posteo.de \
    --to=martink@posteo.de \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®