Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Thorsten Blum and committed by
Dmitry Torokhov
d3561c40 7ef9bdec

+2 -1
+2 -1
drivers/input/joystick/sidewinder.c
··· 14 14 #include <linux/input.h> 15 15 #include <linux/gameport.h> 16 16 #include <linux/jiffies.h> 17 + #include <linux/string_choices.h> 17 18 18 19 #define DRIVER_DESC "Microsoft SideWinder joystick family driver" 19 20 ··· 678 677 case 48: /* Ambiguous */ 679 678 if (j == 14) { /* ID length 14*3 -> FFP */ 680 679 sw->type = SW_ID_FFP; 681 - sprintf(comment, " [AC %s]", sw_get_bits(idbuf,38,1,3) ? "off" : "on"); 680 + sprintf(comment, " [AC %s]", str_off_on(sw_get_bits(idbuf,38,1,3))); 682 681 } else 683 682 sw->type = SW_ID_PP; 684 683 break;