HID: Fix hid_report_len usage
authorAaron Ma <aaron.ma@canonical.com>
Sat, 3 Feb 2018 15:57:15 +0000 (23:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Apr 2018 07:32:07 +0000 (09:32 +0200)
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>
drivers/hid/hid-input.c
drivers/hid/hid-multitouch.c
drivers/hid/hid-rmi.c

index 53e54855c366a0193bafe0c9b1bbee7eefb65362..8d74e691ac90fd759cffa5b6b37ed7d7496b43d0 100644 (file)
@@ -1258,7 +1258,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 f62a9d6601ccac7a2e1c02bf662d910397e09523..9de379c1b3fd30469c8ebcc952a823b914edd95d 100644 (file)
@@ -314,7 +314,8 @@ static 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;
 
        /*
@@ -919,7 +920,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 67cd059a8f46cdf7dab8d73cb0edb7bd5aff1333..41a4a2af9db1be30089d8c2c349ba7e380c05f62 100644 (file)
@@ -110,8 +110,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;