Skip to contentSkip to conversation

HID: hid-gfrm: avoid warning for input_configured API change

PATCH In review Arnd Bergmann 4 participants 5 messages Nov 3, 2015 – Nov 5, 2015 HID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: hid-gfrm: avoid warning for input_configured API change

The input_configured callback was recently changed to return an 'int', but the newly added driver uses the old API:

drivers/hid/hid-gfrm.c:151:22: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]

This changes the driver like the other ones.

Fixes 34fc1322e7aa ("HID: hid-gfrm: Google Fiber TV Box remote controls")
Fixes b2c68a2f1bab ("HID: hid-input: allow input_configured callback return errors")

---
Found on ARM allmodconfig with yesterday's linux-next

drivers/hid/hid-gfrm.c +2 -1
index 4d7b7e7f0792..075b1c020846 100644
@@ -88,7 +88,7 @@ static int gfrm_raw_event(struct hid_device *hdev, struct hid_report *report,
 	return (ret < 0) ? ret : -1;
 }
 
-static void gfrm_input_configured(struct hid_device *hid, struct hid_input *hidinput)
+static int gfrm_input_configured(struct hid_device *hid, struct hid_input *hidinput)
 {
 	/*
 	 * Enable software autorepeat with:
@@ -96,6 +96,7 @@ static void gfrm_input_configured(struct hid_device *hid, struct hid_input *hidi
 	 * - repeat period: 100 msec
 	 */
 	input_enable_softrepeat(hidinput->input, 400, 100);
+	return 0;
 }
 
 static int gfrm_probe(struct hid_device *hdev, const struct hid_device_id *id)
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Arnd Bergmann

The input_configured callback was recently changed to return an 'int', but the newly added driver uses the old API:

drivers/hid/hid-gfrm.c:151:22: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]

This changes the driver like the other ones.

Quoted 27 lines
Fixes 34fc1322e7aa ("HID: hid-gfrm: Google Fiber TV Box remote controls")
Fixes b2c68a2f1bab ("HID: hid-input: allow input_configured callback return errors")

---
Found on ARM allmodconfig with yesterday's linux-next

drivers/hid/hid-gfrm.c +2 -1
index 4d7b7e7f0792..075b1c020846 100644
@@ -88,7 +88,7 @@ static int gfrm_raw_event(struct hid_device *hdev, struct hid_report *report,
        return (ret < 0) ? ret : -1;
 }
 
-static void gfrm_input_configured(struct hid_device *hid, struct hid_input *hidinput)
+static int gfrm_input_configured(struct hid_device *hid, struct hid_input *hidinput)
 {
        /*
         * Enable software autorepeat with:
@@ -96,6 +96,7 @@ static void gfrm_input_configured(struct hid_device *hid, struct hid_input *hidi
         * - repeat period: 100 msec
         */
        input_enable_softrepeat(hidinput->input, 400, 100);
+       return 0;
 }
 
 static int gfrm_probe(struct hid_device *hdev, const struct hid_device_id *id)
#2 lore raw
Quoted 11 lines · Petri Gynther
Quoted 8 lines · Arnd Bergmann

The input_configured callback was recently changed to return an 'int', but the newly added driver uses the old API:

drivers/hid/hid-gfrm.c:151:22: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]

This changes the driver like the other ones.

Hmm, the question is how to merge this, given that one change is in Jiri's tree and another in mine...

Quoted 28 lines
Quoted 28 lines
Fixes 34fc1322e7aa ("HID: hid-gfrm: Google Fiber TV Box remote controls")
Fixes b2c68a2f1bab ("HID: hid-input: allow input_configured callback return errors")

---
Found on ARM allmodconfig with yesterday's linux-next

drivers/hid/hid-gfrm.c +2 -1
index 4d7b7e7f0792..075b1c020846 100644
@@ -88,7 +88,7 @@ static int gfrm_raw_event(struct hid_device *hdev, struct hid_report *report,
        return (ret < 0) ? ret : -1;
 }
 
-static void gfrm_input_configured(struct hid_device *hid, struct hid_input *hidinput)
+static int gfrm_input_configured(struct hid_device *hid, struct hid_input *hidinput)
 {
        /*
         * Enable software autorepeat with:
@@ -96,6 +96,7 @@ static void gfrm_input_configured(struct hid_device *hid, struct hid_input *hidi
         * - repeat period: 100 msec
         */
        input_enable_softrepeat(hidinput->input, 400, 100);
+       return 0;
 }
 
 static int gfrm_probe(struct hid_device *hdev, const struct hid_device_id *id)
Signature · 1 line
Dmitry
maintainer
#3 lore raw
Quoted 5 lines · Dmitry Torokhov
Quoted 5 lines
Quoted 5 lines

The input_configured callback was recently changed to return an 'int', but the newly added driver uses the old API:

drivers/hid/hid-gfrm.c:151:22: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

This changes the driver like the other ones.

Hmm, the question is how to merge this, given that one change is in Jiri's tree and another in mine...

In this case probably the best course of action is you cherry-picking b2c68a2f1bab from my tree into yours, and proceeding further. git can handle doubled commits (that will end up in Linus' tree eventually) easily.

Another option would be to create a joint merge tree that'd contain both branches merged together and proceed further from that, but I don't think it's worth the hassle for simple case like this.

Works for you?

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
#4 lore raw
Quoted 21 lines · Jiri Kosina
Quoted 5 lines · Dmitry Torokhov
Quoted 5 lines
Quoted 5 lines

The input_configured callback was recently changed to return an 'int', but the newly added driver uses the old API:

drivers/hid/hid-gfrm.c:151:22: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

This changes the driver like the other ones.

Hmm, the question is how to merge this, given that one change is in Jiri's tree and another in mine...

In this case probably the best course of action is you cherry-picking b2c68a2f1bab from my tree into yours, and proceeding further. git can handle doubled commits (that will end up in Linus' tree eventually) easily.

Quoted 5 lines

Another option would be to create a joint merge tree that'd contain both branches merged together and proceed further from that, but I don't think it's worth the hassle for simple case like this.

Works for you?

I went the cherry-pick route.

Thanks.

Signature · 1 line
Dmitry