]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
HID: Fix hid_report_len usage
authorAaron Ma <aaron.ma@canonical.com>
Sat, 3 Feb 2018 15:57:15 +0000 (23:57 +0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 6 Jun 2018 15:48:36 +0000 (11:48 -0400)
BugLink: http://bugs.launchpad.net/bugs/1773233
commit 3064a03b94e60388f0955fcc29f3e8a978d28f75 upstream.

Follow the change of return type u32 of hid_report_len,
fix all the types of variables those get the return value of
hid_report_len to u32, and all other code already uses u32.

Cc: stable@vger.kernel.org
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/hid/hid-input.c
drivers/hid/hid-multitouch.c
drivers/hid/hid-rmi.c
drivers/hid/wacom_sys.c

index 04d01b57d94c8280d2d6a63ef863136165555c11..d86398755b0d013ee26b619622822b00bd5ee1d2 100644 (file)
@@ -1368,7 +1368,8 @@ static void hidinput_led_worker(struct work_struct *work)
                                              led_work);
        struct hid_field *field;
        struct hid_report *report;
-       int len, ret;
+       int ret;
+       u32 len;
        __u8 *buf;
 
        field = hidinput_get_led_field(hid);
index 845f2418f374cbc6678a59d85d0ac23da582b96b..e8dcd433937ef655f5589ce2c991997a56824483 100644 (file)
@@ -365,7 +365,8 @@ static const struct attribute_group mt_attribute_group = {
 static void mt_get_feature(struct hid_device *hdev, struct hid_report *report)
 {
        struct mt_device *td = hid_get_drvdata(hdev);
-       int ret, size = hid_report_len(report);
+       int ret;
+       u32 size = hid_report_len(report);
        u8 *buf;
 
        /*
@@ -1092,7 +1093,7 @@ static void mt_set_input_mode(struct hid_device *hdev)
        struct hid_report_enum *re;
        struct mt_class *cls = &td->mtclass;
        char *buf;
-       int report_len;
+       u32 report_len;
 
        if (td->inputmode < 0)
                return;
index 0f43c4292685fcd4bcde4eeeb6268d17a31fe89e..9c2f7ed8030e4aec3805db9cba0ed00c4f7e92a4 100644 (file)
@@ -89,8 +89,8 @@ struct rmi_data {
        u8 *writeReport;
        u8 *readReport;
 
-       int input_report_size;
-       int output_report_size;
+       u32 input_report_size;
+       u32 output_report_size;
 
        unsigned long flags;
 
index 76531796bd3cdfa6577ce4ab3ae727e2c7f3cb2b..54638f7dc97214964a7fb34025b7fe611f831e60 100644 (file)
@@ -115,7 +115,7 @@ static void wacom_feature_mapping(struct hid_device *hdev,
        unsigned int equivalent_usage = wacom_equivalent_usage(usage->hid);
        u8 *data;
        int ret;
-       int n;
+       u32 n;
 
        switch (equivalent_usage) {
        case HID_DG_CONTACTMAX:
@@ -415,7 +415,7 @@ static int wacom_set_device_mode(struct hid_device *hdev,
        u8 *rep_data;
        struct hid_report *r;
        struct hid_report_enum *re;
-       int length;
+       u32 length;
        int error = -ENOMEM, limit = 0;
 
        if (wacom_wac->mode_report < 0)