HID: huion: Fix sparse warnings
authorNikolai Kondrashov <spbnick@gmail.com>
Tue, 29 Jul 2014 12:50:06 +0000 (15:50 +0300)
committerJiri Kosina <jkosina@suse.cz>
Tue, 29 Jul 2014 13:07:08 +0000 (15:07 +0200)
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

Reported-by: fengguang.wu@intel.com
Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-huion.c

index 438b54e147bbad853a508e7c0197ceeb4c9300b7..60f44cd1b0ed30ec19e986800676311bb72dadac 100644 (file)
@@ -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