[PATCH] HID: wiimote: change wiimote_cmd_map_mp() to return void

Ethan Tidmore posted 1 patch 1 month, 2 weeks ago
drivers/hid/hid-wiimote-core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] HID: wiimote: change wiimote_cmd_map_mp() to return void
Posted by Ethan Tidmore 1 month, 2 weeks ago
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)'

Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
---
 drivers/hid/hid-wiimote-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/hid-wiimote-core.c b/drivers/hid/hid-wiimote-core.c
index 5b5fc460a4c5..c4d11ff3c898 100644
--- a/drivers/hid/hid-wiimote-core.c
+++ b/drivers/hid/hid-wiimote-core.c
@@ -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 */
-- 
2.53.0