* [PATCH] powerpc: mpic: Use str_enabled_disabled() helper function
@ 2025-02-04 15:44 Thorsten Blum
2025-02-04 18:00 ` Ricardo B. Marlière
0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2025-02-04 15:44 UTC (permalink / raw)
To: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Greg Kroah-Hartman,
Ricardo B. Marliere
Cc: Thorsten Blum, linuxppc-dev, linux-kernel
Remove hard-coded strings by using the str_enabled_disabled() helper
function.
Use pr_debug() instead of printk(KERN_DEBUG) to silence a checkpatch
warning.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
arch/powerpc/sysdev/mpic.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index d94cf36b0f65..25fc4ac91814 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -27,6 +27,7 @@
#include <linux/spinlock.h>
#include <linux/pci.h>
#include <linux/slab.h>
+#include <linux/string_choices.h>
#include <linux/syscore_ops.h>
#include <linux/ratelimit.h>
#include <linux/pgtable.h>
@@ -474,9 +475,9 @@ static void __init mpic_scan_ht_msi(struct mpic *mpic, u8 __iomem *devbase,
addr = addr | ((u64)readl(base + HT_MSI_ADDR_HI) << 32);
}
- printk(KERN_DEBUG "mpic: - HT:%02x.%x %s MSI mapping found @ 0x%llx\n",
- PCI_SLOT(devfn), PCI_FUNC(devfn),
- flags & HT_MSI_FLAGS_ENABLE ? "enabled" : "disabled", addr);
+ pr_debug("mpic: - HT:%02x.%x %s MSI mapping found @ 0x%llx\n",
+ PCI_SLOT(devfn), PCI_FUNC(devfn),
+ str_enabled_disabled(flags & HT_MSI_FLAGS_ENABLE), addr);
if (!(flags & HT_MSI_FLAGS_ENABLE))
writeb(flags | HT_MSI_FLAGS_ENABLE, base + HT_MSI_FLAGS);
--
2.48.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] powerpc: mpic: Use str_enabled_disabled() helper function
2025-02-04 15:44 [PATCH] powerpc: mpic: Use str_enabled_disabled() helper function Thorsten Blum
@ 2025-02-04 18:00 ` Ricardo B. Marlière
0 siblings, 0 replies; 2+ messages in thread
From: Ricardo B. Marlière @ 2025-02-04 18:00 UTC (permalink / raw)
To: Thorsten Blum, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Greg Kroah-Hartman
Cc: linuxppc-dev, linux-kernel
On Tue Feb 4, 2025 at 12:44 PM -03, Thorsten Blum wrote:
> Remove hard-coded strings by using the str_enabled_disabled() helper
> function.
>
> Use pr_debug() instead of printk(KERN_DEBUG) to silence a checkpatch
> warning.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Ricardo B. Marlière <ricardo@marliere.net>
> ---
> arch/powerpc/sysdev/mpic.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
> index d94cf36b0f65..25fc4ac91814 100644
> --- a/arch/powerpc/sysdev/mpic.c
> +++ b/arch/powerpc/sysdev/mpic.c
> @@ -27,6 +27,7 @@
> #include <linux/spinlock.h>
> #include <linux/pci.h>
> #include <linux/slab.h>
> +#include <linux/string_choices.h>
> #include <linux/syscore_ops.h>
> #include <linux/ratelimit.h>
> #include <linux/pgtable.h>
> @@ -474,9 +475,9 @@ static void __init mpic_scan_ht_msi(struct mpic *mpic, u8 __iomem *devbase,
> addr = addr | ((u64)readl(base + HT_MSI_ADDR_HI) << 32);
> }
>
> - printk(KERN_DEBUG "mpic: - HT:%02x.%x %s MSI mapping found @ 0x%llx\n",
> - PCI_SLOT(devfn), PCI_FUNC(devfn),
> - flags & HT_MSI_FLAGS_ENABLE ? "enabled" : "disabled", addr);
> + pr_debug("mpic: - HT:%02x.%x %s MSI mapping found @ 0x%llx\n",
> + PCI_SLOT(devfn), PCI_FUNC(devfn),
> + str_enabled_disabled(flags & HT_MSI_FLAGS_ENABLE), addr);
>
> if (!(flags & HT_MSI_FLAGS_ENABLE))
> writeb(flags | HT_MSI_FLAGS_ENABLE, base + HT_MSI_FLAGS);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-04 18:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-04 15:44 [PATCH] powerpc: mpic: Use str_enabled_disabled() helper function Thorsten Blum
2025-02-04 18:00 ` Ricardo B. Marlière
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).