[hid:for-4.18/multitouch 7/7] drivers/hid/hid-multitouch.c:1209:9-10: WARNING: return of 0/1 in function 'mt_need_to_apply_feature' with return type bool

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid.git for-4.18/multitouch
head:   02946f4b43b11026b1a76857a33b09078b900939
commit: 02946f4b43b11026b1a76857a33b09078b900939 [7/7] HID: multitouch: implement precision touchpad latency and switches


coccinelle warnings: (new ones prefixed by >>)

>> drivers/hid/hid-multitouch.c:1209:9-10: WARNING: return of 0/1 in function 'mt_need_to_apply_feature' with return type bool

vim +/mt_need_to_apply_feature +1209 drivers/hid/hid-multitouch.c

  1161	
  1162	static bool mt_need_to_apply_feature(struct hid_device *hdev,
  1163					     struct hid_field *field,
  1164					     struct hid_usage *usage,
  1165					     enum latency_mode latency,
  1166					     bool surface_switch,
  1167					     bool button_switch)
  1168	{
  1169		struct mt_device *td = hid_get_drvdata(hdev);
  1170		struct mt_class *cls = &td->mtclass;
  1171		struct hid_report *report = field->report;
  1172		unsigned int index = usage->usage_index;
  1173		char *buf;
  1174		u32 report_len;
  1175		int max;
  1176	
  1177		switch (usage->hid) {
  1178		case HID_DG_INPUTMODE:
  1179			if (cls->quirks & MT_QUIRK_FORCE_GET_FEATURE) {
  1180				report_len = hid_report_len(report);
  1181				buf = hid_alloc_report_buf(report, GFP_KERNEL);
  1182				if (!buf) {
  1183					hid_err(hdev,
  1184						"failed to allocate buffer for report\n");
  1185					return false;
  1186				}
  1187				hid_hw_raw_request(hdev, report->id, buf, report_len,
  1188						   HID_FEATURE_REPORT,
  1189						   HID_REQ_GET_REPORT);
  1190				kfree(buf);
  1191			}
  1192	
  1193			field->value[index] = td->inputmode_value;
  1194			return true;
  1195	
  1196		case HID_DG_CONTACTMAX:
  1197			if (td->mtclass.maxcontacts) {
  1198				max = min_t(int, field->logical_maximum,
  1199					    td->mtclass.maxcontacts);
  1200				if (field->value[index] != max) {
  1201					field->value[index] = max;
  1202					return true;
  1203				}
  1204			}
  1205			break;
  1206	
  1207		case HID_DG_LATENCYMODE:
  1208			field->value[index] = latency;
> 1209			return 1;
  1210	
  1211		case HID_DG_SURFACESWITCH:
  1212			field->value[index] = surface_switch;
  1213			return 1;
  1214	
  1215		case HID_DG_BUTTONSWITCH:
  1216			field->value[index] = button_switch;
  1217			return 1;
  1218		}
  1219	
  1220		return false; /* no need to update the report */
  1221	}
  1222	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux