linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolai Kondrashov <spbnick@gmail.com>
To: Jiri Kosina <jkosina@suse.cz>
Cc: linux-input@vger.kernel.org,
	DIGImend-devel <DIGImend-devel@lists.sourceforge.net>,
	Benjamin Tissoires <benjamin.tissoires@gmail.com>,
	Nikolai Kondrashov <spbnick@gmail.com>
Subject: [PATCH] hid: huion: Fix sparse warnings
Date: Tue, 29 Jul 2014 15:50:06 +0300	[thread overview]
Message-ID: <1406638206-6108-1-git-send-email-spbnick@gmail.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1407291121530.16390@pobox.suse.cz>

Fix sparse warnings in hid-huion.c by using correct buffer type for
retrieved string descriptor.

The warnings in question were:

    drivers/hid/hid-huion.c:144:44: sparse: cast to restricted __le16
    drivers/hid/hid-huion.c:145:44: sparse: cast to restricted __le16
    drivers/hid/hid-huion.c:146:51: sparse: cast to restricted __le16
    drivers/hid/hid-huion.c:147:30: sparse: cast to restricted __le16

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
---

Hi Jiri, Benjamin,

Thanks for the review. There is one minor problem, though. I didn't run a
sparse check and only just got a message with "sparse" warnings. This patch
fixes them.

If you wouldn't like adding a tiny patch like this, I can send another version
of the original patches. Otherwise, please feel free to just fixup my "Switch
to generating report descriptor" commit with this one.

I'll try to remember to run sparse next time before submitting the patches.

Thank you.

Nick

 drivers/hid/hid-huion.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-huion.c b/drivers/hid/hid-huion.c
index 438b54e..60f44cd 100644
--- a/drivers/hid/hid-huion.c
+++ b/drivers/hid/hid-huion.c
@@ -115,7 +115,7 @@ static int huion_tablet_enable(struct hid_device *hdev)
 	int rc;
 	struct usb_device *usb_dev = hid_to_usb_dev(hdev);
 	struct huion_drvdata *drvdata = hid_get_drvdata(hdev);
-	u16 buf[6];
+	__le16 buf[6];
 
 	/*
 	 * Read string descriptor containing tablet parameters. The specific
-- 
2.0.1


  reply	other threads:[~2014-07-29 12:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-23 12:42 [PATCHES] hid: Add support for more Huion tablets Nikolai Kondrashov
2014-07-23 12:42 ` [PATCH 1/5] hid: huion: Use "tablet" instead of specific model Nikolai Kondrashov
2014-07-23 14:30   ` Benjamin Tissoires
2014-07-23 12:42 ` [PATCH 2/5] hid: huion: Invert in-range on specific product Nikolai Kondrashov
2014-07-23 14:34   ` Benjamin Tissoires
2014-07-23 14:40     ` Nikolai Kondrashov
2014-07-23 16:31       ` [PATCHES v2] Add support for more Huion tablets Nikolai Kondrashov
2014-07-23 16:31         ` [PATCH 1/4] hid: huion: Use "tablet" instead of specific model Nikolai Kondrashov
2014-07-23 16:31         ` [PATCH 2/4] hid: huion: Don't ignore other interfaces Nikolai Kondrashov
2014-07-23 16:31         ` [PATCH 3/4] hid: huion: Switch to generating report descriptor Nikolai Kondrashov
2014-07-23 16:31         ` [PATCH 4/4] hid: huion: Handle tablets with UC-Logic vendor ID Nikolai Kondrashov
2014-07-28 15:33         ` [PATCHES v2] Add support for more Huion tablets Benjamin Tissoires
2014-07-29  9:22           ` Jiri Kosina
2014-07-29 12:50             ` Nikolai Kondrashov [this message]
2014-07-29 13:06               ` [PATCH] hid: huion: Fix sparse warnings Jiri Kosina
2014-07-29 13:24                 ` Nikolai Kondrashov
2014-07-23 12:42 ` [PATCH 3/5] hid: huion: Don't ignore other interfaces Nikolai Kondrashov
2014-07-23 14:43   ` Benjamin Tissoires
2014-07-23 12:42 ` [PATCH 4/5] hid: huion: Switch to generating report descriptor Nikolai Kondrashov
2014-07-23 14:42   ` Benjamin Tissoires
2014-07-23 14:59     ` Nikolai Kondrashov
2014-07-23 12:42 ` [PATCH 5/5] hid: huion: Handle tablets with UC-Logic vendor ID Nikolai Kondrashov
2014-07-23 14:43   ` Benjamin Tissoires
2014-07-23 13:39 ` [PATCHES] hid: Add support for more Huion tablets Nikolai Kondrashov

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=1406638206-6108-1-git-send-email-spbnick@gmail.com \
    --to=spbnick@gmail.com \
    --cc=DIGImend-devel@lists.sourceforge.net \
    --cc=benjamin.tissoires@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.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;
as well as URLs for NNTP newsgroup(s).