Skip to content

Commit

Permalink
HID: Fix hid_report_len usage
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Aaron Ma authored and Jiri Kosina committed Feb 16, 2018
1 parent 6de0b13 commit 3064a03
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion drivers/hid/hid-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions drivers/hid/hid-multitouch.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,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;

/*
Expand Down Expand Up @@ -1183,7 +1184,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;
Expand Down
4 changes: 2 additions & 2 deletions drivers/hid/hid-rmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions drivers/hid/wacom_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,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:
Expand Down Expand Up @@ -519,7 +519,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)
Expand Down

0 comments on commit 3064a03

Please sign in to comment.