]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Input: joystick - use str_off_on() helper in sw_connect()
authorThorsten Blum <thorsten.blum@linux.dev>
Tue, 14 Jan 2025 21:41:06 +0000 (13:41 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 14 Jan 2025 21:41:43 +0000 (13:41 -0800)
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>
drivers/input/joystick/sidewinder.c

index f6e92db4d78965e58ee40db09d7ed04ec017fa90..3a5873e5fcb30a6520fc5a6ef5ae54a5035e2cc5 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/input.h>
 #include <linux/gameport.h>
 #include <linux/jiffies.h>
+#include <linux/string_choices.h>
 
 #define DRIVER_DESC    "Microsoft SideWinder joystick family driver"
 
@@ -677,7 +678,7 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv)
                                case 48:                                /* Ambiguous */
                                        if (j == 14) {                  /* ID length 14*3 -> FFP */
                                                sw->type = SW_ID_FFP;
-                                               sprintf(comment, " [AC %s]", sw_get_bits(idbuf,38,1,3) ? "off" : "on");
+                                               sprintf(comment, " [AC %s]", str_off_on(sw_get_bits(idbuf,38,1,3)));
                                        } else
                                                sw->type = SW_ID_PP;
                                        break;