Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

authored by

Jiri Slaby and committed by
Jiri Kosina
282bfd4c 377e10fb

+7 -6
+1 -1
drivers/hid/hid-core.c
··· 97 97 field->index = report->maxfield++; 98 98 report->field[field->index] = field; 99 99 field->usage = (struct hid_usage *)(field + 1); 100 - field->value = (unsigned *)(field->usage + usages); 100 + field->value = (s32 *)(field->usage + usages); 101 101 field->report = report; 102 102 103 103 return field;
+1 -1
drivers/hid/hid-input-quirks.c
··· 353 353 354 354 { VENDOR_ID_SUNPLUS, DEVICE_ID_SUNPLUS_WDESKTOP, quirk_sunplus_wdesktop }, 355 355 356 - { 0, 0, 0 } 356 + { 0, 0, NULL } 357 357 }; 358 358 359 359 int hidinput_mapping_quirks(struct hid_usage *usage,
+5 -4
drivers/hid/usbhid/hid-core.c
··· 610 610 /* 611 611 * Traverse the supplied list of reports and find the longest 612 612 */ 613 - static void hid_find_max_report(struct hid_device *hid, unsigned int type, int *max) 613 + static void hid_find_max_report(struct hid_device *hid, unsigned int type, 614 + unsigned int *max) 614 615 { 615 616 struct hid_report *report; 616 - int size; 617 + unsigned int size; 617 618 618 619 list_for_each_entry(report, &hid->report_enum[type].report_list, list) { 619 620 size = ((report->size - 1) >> 3) + 1; ··· 706 705 struct hid_descriptor *hdesc; 707 706 struct hid_device *hid; 708 707 u32 quirks = 0; 709 - unsigned rsize = 0; 708 + unsigned int insize = 0, rsize = 0; 710 709 char *rdesc; 711 - int n, len, insize = 0; 710 + int n, len; 712 711 struct usbhid_device *usbhid; 713 712 714 713 quirks = usbhid_lookup_quirk(le16_to_cpu(dev->descriptor.idVendor),