Skip to contentSkip to conversation

sonypi: Use str_on_off() helper in sonypi_display_info()

PATCH In review Thorsten Blum 2 participants 2 messages Feb 10, 2025 – Feb 13, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sonypi: Use str_on_off() helper in sonypi_display_info()

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

---
 drivers/char/sonypi.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/char/sonypi.c +6 -5
index f887569fd3d0..677bb5ac950a 100644
@@ -37,6 +37,7 @@
 #include <linux/kfifo.h>
 #include <linux/platform_device.h>
 #include <linux/gfp.h>
+#include <linux/string_choices.h>
 
 #include <linux/uaccess.h>
 #include <asm/io.h>
@@ -1268,12 +1269,12 @@ static void sonypi_display_info(void)
 	       "compat = %s, mask = 0x%08lx, useinput = %s, acpi = %s\n",
 	       sonypi_device.model,
 	       verbose,
-	       fnkeyinit ? "on" : "off",
-	       camera ? "on" : "off",
-	       compat ? "on" : "off",
+	       str_on_off(fnkeyinit),
+	       str_on_off(camera),
+	       str_on_off(compat),
 	       mask,
-	       useinput ? "on" : "off",
-	       SONYPI_ACPI_ACTIVE ? "on" : "off");
+	       str_on_off(useinput),
+	       str_on_off(SONYPI_ACPI_ACTIVE));
 	printk(KERN_INFO "sonypi: enabled at irq=%d, port1=0x%x, port2=0x%x\n",
 	       sonypi_device.irq,
 	       sonypi_device.ioport1, sonypi_device.ioport2);
Signature · 1 line
2.48.1
maintainer
#1 lore raw
Quoted 3 lines · Thorsten Blum

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

Thank you for your contribution, it has been applied to my local review-ilpo-next branch. Note it will show up in the public platform-drivers-x86/review-ilpo-next branch only once I've pushed my local branch there, which might take a while.

The list of commits applied:
[1/1] sonypi: Use str_on_off() helper in sonypi_display_info()

      commit: 9cf1c75bfda5168b82ba19576267d5cad0327b9f

--
i.