powerpc/powermac: Use str_enabled_disabled() and str_on_off() helpers
authorThorsten Blum <thorsten.blum@linux.dev>
Fri, 17 Jan 2025 11:46:20 +0000 (12:46 +0100)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Thu, 15 May 2025 04:32:18 +0000 (10:02 +0530)
Remove hard-coded strings by using the str_enabled_disabled() and
str_on_off() helper functions.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20250117114625.64903-2-thorsten.blum@linux.dev
arch/powerpc/platforms/powermac/setup.c
arch/powerpc/platforms/powermac/time.c

index 6de1cd5d8a5833ffc758600c8bd690b3260f069e..e119ced05d10360f692b7c23a56aa2b32d556660 100644 (file)
@@ -45,6 +45,7 @@
 #include <linux/root_dev.h>
 #include <linux/bitops.h>
 #include <linux/suspend.h>
+#include <linux/string_choices.h>
 #include <linux/of.h>
 #include <linux/of_platform.h>
 
@@ -238,8 +239,7 @@ static void __init l2cr_init(void)
                                _set_L2CR(0);
                                _set_L2CR(*l2cr);
                                pr_info("L2CR overridden (0x%x), backside cache is %s\n",
-                                       *l2cr, ((*l2cr) & 0x80000000) ?
-                                       "enabled" : "disabled");
+                                       *l2cr, str_enabled_disabled((*l2cr) & 0x80000000));
                        }
                        of_node_put(np);
                        break;
index 8633891b7aa58027863192a5e87663190cda996b..b4426a35aca33b16910acf49dd4bfc9bc22d2f68 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/kernel.h>
 #include <linux/param.h>
 #include <linux/string.h>
+#include <linux/string_choices.h>
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <linux/time.h>
@@ -77,7 +78,7 @@ long __init pmac_time_init(void)
                delta |= 0xFF000000UL;
        dst = ((pmac_xpram_read(PMAC_XPRAM_MACHINE_LOC + 0x8) & 0x80) != 0);
        printk("GMT Delta read from XPRAM: %d minutes, DST: %s\n", delta/60,
-               dst ? "on" : "off");
+               str_on_off(dst));
 #endif
        return delta;
 }