Skip to content

Commit d3561c4

Browse files
tobluxdtor
authored andcommitted
Input: joystick - use str_off_on() helper in sw_connect()
Remove hard-coded strings by using the str_off_on() helper. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Link: https://lore.kernel.org/r/20241202154603.1193-2-thorsten.blum@linux.dev Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 7ef9bde commit d3561c4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/input/joystick/sidewinder.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/input.h>
1515
#include <linux/gameport.h>
1616
#include <linux/jiffies.h>
17+
#include <linux/string_choices.h>
1718

1819
#define DRIVER_DESC "Microsoft SideWinder joystick family driver"
1920

@@ -677,7 +678,7 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv)
677678
case 48: /* Ambiguous */
678679
if (j == 14) { /* ID length 14*3 -> FFP */
679680
sw->type = SW_ID_FFP;
680-
sprintf(comment, " [AC %s]", sw_get_bits(idbuf,38,1,3) ? "off" : "on");
681+
sprintf(comment, " [AC %s]", str_off_on(sw_get_bits(idbuf,38,1,3)));
681682
} else
682683
sw->type = SW_ID_PP;
683684
break;

0 commit comments

Comments
 (0)