Skip to contentSkip to conversation

HID: wiimote: change wiimote_cmd_map_mp() to return void

PATCH New Ethan Tidmore 1 participant 1 message Feb 16

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: wiimote: change wiimote_cmd_map_mp() to return void

The function wiimote_cmd_map_mp() returns bool but no variable is ever assigned to its return value. Also, by it returning bool it causes a signedness warning from Smatch because wiimote_cmd_write() can return -EIO.

Detected by Smatch:
drivers/hid/hid-wiimote-core.c:510 wiimote_cmd_map_mp() warn:
signedness bug returning '(-512)'

---
 drivers/hid/hid-wiimote-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hid/hid-wiimote-core.c +2 -2
index 5b5fc460a4c5..c4d11ff3c898 100644
@@ -487,7 +487,7 @@ static int wiimote_cmd_init_mp(struct wiimote_data *wdata)
 }
 
 /* requires the cmd-mutex to be held */
-static bool wiimote_cmd_map_mp(struct wiimote_data *wdata, __u8 exttype)
+static void wiimote_cmd_map_mp(struct wiimote_data *wdata, __u8 exttype)
 {
 	__u8 wmem;
 
@@ -507,7 +507,7 @@ static bool wiimote_cmd_map_mp(struct wiimote_data *wdata, __u8 exttype)
 		break;
 	}
 
-	return wiimote_cmd_write(wdata, 0xa600fe, &wmem, sizeof(wmem));
+	wiimote_cmd_write(wdata, 0xa600fe, &wmem, sizeof(wmem));
 }
 
 /* requires the cmd-mutex to be held */
Signature · 1 line
2.53.0