Skip to contentSkip to conversation

MIPS: Loongson64: env: Use str_on_off() helper in prom_lefi_init_env()

PATCH Applied Thorsten Blum 2 participants 2 messages Jan 15, 2025 – Jan 20, 2025

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

PATCH 1/1 MIPS: Loongson64: env: Use str_on_off() helper in prom_lefi_init_env()

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

---
 arch/mips/loongson64/env.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/mips/loongson64/env.c +2 -1
index 09ff05269861..be8d2ad10750 100644
@@ -17,6 +17,7 @@
 #include <linux/dma-map-ops.h>
 #include <linux/export.h>
 #include <linux/pci_ids.h>
+#include <linux/string_choices.h>
 #include <asm/bootinfo.h>
 #include <loongson.h>
 #include <boot_param.h>
@@ -162,7 +163,7 @@ void __init prom_lefi_init_env(void)
 		dma_default_coherent = !eirq_source->dma_noncoherent;
 	}
 
-	pr_info("Firmware: Coherent DMA: %s\n", dma_default_coherent ? "on" : "off");
+	pr_info("Firmware: Coherent DMA: %s\n", str_on_off(dma_default_coherent));
 
 	loongson_sysconf.restart_addr = boot_p->reset_system.ResetWarm;
 	loongson_sysconf.poweroff_addr = boot_p->reset_system.Shutdown;
Signature · 1 line
2.47.1
maintainer Applied
#1 lore raw
Quoted 30 lines · Thorsten Blum

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

---
 arch/mips/loongson64/env.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/mips/loongson64/env.c +2 -1
index 09ff05269861..be8d2ad10750 100644
@@ -17,6 +17,7 @@
 #include <linux/dma-map-ops.h>
 #include <linux/export.h>
 #include <linux/pci_ids.h>
+#include <linux/string_choices.h>
 #include <asm/bootinfo.h>
 #include <loongson.h>
 #include <boot_param.h>
@@ -162,7 +163,7 @@ void __init prom_lefi_init_env(void)
 		dma_default_coherent = !eirq_source->dma_noncoherent;
 	}
 
-	pr_info("Firmware: Coherent DMA: %s\n", dma_default_coherent ? "on" : "off");
+	pr_info("Firmware: Coherent DMA: %s\n", str_on_off(dma_default_coherent));
 
 	loongson_sysconf.restart_addr = boot_p->reset_system.ResetWarm;
 	loongson_sysconf.poweroff_addr = boot_p->reset_system.Shutdown;
Signature · 1 line
2.47.1

applied to mips-next.

Thomas.

Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]