Commit 282bfd4c authored by Jiri Slaby's avatar Jiri Slaby Committed by Jiri Kosina

HID: fix sparse warnings

Fix these sparse warnings:
.../hid/hid-core.c:100:15: warning: incorrect type in assignment (different signedness)
.../hid/hid-core.c:100:15:    expected signed int [usertype] *value
.../hid/hid-core.c:100:15:    got unsigned int *<noident>
        by unsigned -> s32

.../hid/hid-input-quirks.c:336:10: warning: Using plain integer as NULL pointer
        by 0 -> NULL

.../hid/usbhid/hid-core.c:786:46: warning: incorrect type in argument 3 (different signedness)
.../hid/usbhid/hid-core.c:786:46:    expected int *max
.../hid/usbhid/hid-core.c:786:46:    got unsigned int *<noident>
.../hid/usbhid/hid-core.c:787:47: warning: incorrect type in argument 3 (different signedness)
.../hid/usbhid/hid-core.c:787:47:    expected int *max
.../hid/usbhid/hid-core.c:787:47:    got unsigned int *<noident>
.../hid/usbhid/hid-core.c:788:48: warning: incorrect type in argument 3 (different signedness)
.../hid/usbhid/hid-core.c:788:48:    expected int *max
.../hid/usbhid/hid-core.c:788:48:    got unsigned int *<noident>
        by int -> unsigned int
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 377e10fb
...@@ -97,7 +97,7 @@ static struct hid_field *hid_register_field(struct hid_report *report, unsigned ...@@ -97,7 +97,7 @@ static struct hid_field *hid_register_field(struct hid_report *report, unsigned
field->index = report->maxfield++; field->index = report->maxfield++;
report->field[field->index] = field; report->field[field->index] = field;
field->usage = (struct hid_usage *)(field + 1); field->usage = (struct hid_usage *)(field + 1);
field->value = (unsigned *)(field->usage + usages); field->value = (s32 *)(field->usage + usages);
field->report = report; field->report = report;
return field; return field;
......
...@@ -353,7 +353,7 @@ static const struct hid_input_blacklist { ...@@ -353,7 +353,7 @@ static const struct hid_input_blacklist {
{ VENDOR_ID_SUNPLUS, DEVICE_ID_SUNPLUS_WDESKTOP, quirk_sunplus_wdesktop }, { VENDOR_ID_SUNPLUS, DEVICE_ID_SUNPLUS_WDESKTOP, quirk_sunplus_wdesktop },
{ 0, 0, 0 } { 0, 0, NULL }
}; };
int hidinput_mapping_quirks(struct hid_usage *usage, int hidinput_mapping_quirks(struct hid_usage *usage,
......
...@@ -610,10 +610,11 @@ static void usbhid_set_leds(struct hid_device *hid) ...@@ -610,10 +610,11 @@ static void usbhid_set_leds(struct hid_device *hid)
/* /*
* Traverse the supplied list of reports and find the longest * Traverse the supplied list of reports and find the longest
*/ */
static void hid_find_max_report(struct hid_device *hid, unsigned int type, int *max) static void hid_find_max_report(struct hid_device *hid, unsigned int type,
unsigned int *max)
{ {
struct hid_report *report; struct hid_report *report;
int size; unsigned int size;
list_for_each_entry(report, &hid->report_enum[type].report_list, list) { list_for_each_entry(report, &hid->report_enum[type].report_list, list) {
size = ((report->size - 1) >> 3) + 1; size = ((report->size - 1) >> 3) + 1;
...@@ -705,9 +706,9 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) ...@@ -705,9 +706,9 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf)
struct hid_descriptor *hdesc; struct hid_descriptor *hdesc;
struct hid_device *hid; struct hid_device *hid;
u32 quirks = 0; u32 quirks = 0;
unsigned rsize = 0; unsigned int insize = 0, rsize = 0;
char *rdesc; char *rdesc;
int n, len, insize = 0; int n, len;
struct usbhid_device *usbhid; struct usbhid_device *usbhid;
quirks = usbhid_lookup_quirk(le16_to_cpu(dev->descriptor.idVendor), quirks = usbhid_lookup_quirk(le16_to_cpu(dev->descriptor.idVendor),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment