Skip to contentSkip to conversation

HID: google_hammer: Fix invalid ENOSYS warning and unsigned.

PATCH In review Guy Chronister 2 participants 2 messages Dec 12, 2023 – Dec 18, 2023 HID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: google_hammer: Fix invalid ENOSYS warning and unsigned.

Fixed warnings about ENOSYS and bare unsigned without int.

---
 drivers/hid/hid-google-hammer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hid/hid-google-hammer.c +2 -2
index c6bdb9c4ef3e..d567f020bead 100644
@@ -324,7 +324,7 @@ static int hammer_kbd_brightness_set_blocking(struct led_classdev *cdev,
 	}
 
 	ret = hid_hw_output_report(led->hdev, led->buf, sizeof(led->buf));
-	if (ret == -ENOSYS)
+	if (ret == -EINVAL)
 		ret = hid_hw_raw_request(led->hdev, 0, led->buf,
 					 sizeof(led->buf),
 					 HID_OUTPUT_REPORT,
@@ -420,7 +420,7 @@ static int hammer_event(struct hid_device *hid, struct hid_field *field,
 }
 
 static bool hammer_has_usage(struct hid_device *hdev, unsigned int report_type,
-			unsigned application, unsigned usage)
+			unsigned int application, unsigned int usage)
 {
 	struct hid_report_enum *re = &hdev->report_enum[report_type];
 	struct hid_report *report;
Signature · 1 line
2.40.1
#1 lore raw
Quoted 12 lines · Guy Chronister

Fixed warnings about ENOSYS and bare unsigned without int.

---
 drivers/hid/hid-google-hammer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hid/hid-google-hammer.c +0 -0
index c6bdb9c4ef3e..d567f020bead 100644

drivers/hid/hid-google-hammer.c static int hammer_kbd_brightness_set_blocking(struct led_classdev *cdev, · line 330

Quoted 8 lines
drivers/hid/hid-google-hammer.c +1 -1
@@ -324,7 +324,7 @@ static int hammer_kbd_brightness_set_blocking(struct led_classdev *cdev,
 	}
 
 	ret = hid_hw_output_report(led->hdev, led->buf, sizeof(led->buf));
-	if (ret == -ENOSYS)
+	if (ret == -EINVAL)
 		ret = hid_hw_raw_request(led->hdev, 0, led->buf,
 					 sizeof(led->buf),
 					 HID_OUTPUT_REPORT,

Could you please elaborate why this is funcionally correct thing to do? How are you now handling the special case when hdev->ll_driver->output_report() callback doesn't exist for the specific low-level driver?

Signature · 2 lines
Jiri Kosina
SUSE Labs