HID: wiimote: change wiimote_cmd_map_mp() to return void
Subsystems (2)
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)'
Signed-off-by Ethan Tidmore <[email protected]>
--- drivers/hid/hid-wiimote-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hid/hid-wiimote-core.c +2 -2
@@ -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