linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: joystick - use str_off_on() helper in sw_connect()
@ 2024-12-02 15:46 Thorsten Blum
  2025-01-14 21:43 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2024-12-02 15:46 UTC (permalink / raw)
  To: Dmitry Torokhov, Erick Archer; +Cc: Thorsten Blum, linux-input, linux-kernel

Remove hard-coded strings by using the str_off_on() helper.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 drivers/input/joystick/sidewinder.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c
index f6e92db4d789..3a5873e5fcb3 100644
--- a/drivers/input/joystick/sidewinder.c
+++ b/drivers/input/joystick/sidewinder.c
@@ -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;
-- 
2.47.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Input: joystick - use str_off_on() helper in sw_connect()
  2024-12-02 15:46 [PATCH] Input: joystick - use str_off_on() helper in sw_connect() Thorsten Blum
@ 2025-01-14 21:43 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2025-01-14 21:43 UTC (permalink / raw)
  To: Thorsten Blum; +Cc: Erick Archer, linux-input, linux-kernel

On Mon, Dec 02, 2024 at 04:46:00PM +0100, Thorsten Blum wrote:
> Remove hard-coded strings by using the str_off_on() helper.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>

Applied, thank you.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-14 21:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-02 15:46 [PATCH] Input: joystick - use str_off_on() helper in sw_connect() Thorsten Blum
2025-01-14 21:43 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).