[RESEND PATCH] powerpc: mpic: Use str_enabled_disabled() helper function

Thorsten Blum posted 1 patch 9 months, 3 weeks ago
arch/powerpc/sysdev/mpic.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
[RESEND PATCH] powerpc: mpic: Use str_enabled_disabled() helper function
Posted by Thorsten Blum 9 months, 3 weeks ago
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.

Reviewed-by: Ricardo B. Marlière <ricardo@marliere.net>
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.1

Re: [RESEND PATCH] powerpc: mpic: Use str_enabled_disabled() helper function
Posted by Christophe Leroy 9 months, 3 weeks ago
Hi,

Le 19/02/2025 à 12:20, Thorsten Blum a écrit :
> 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.
> 
> Reviewed-by: Ricardo B. Marlière <ricardo@marliere.net>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---


When you resend a patch, please tell why here (below the ---) so that we 
know the reason.

At the time being I have several duplicated patches from you and I don't 
know what to do with them which one to keep and which one to drop.

The list is here:

https://patchwork.ozlabs.org/project/linuxppc-dev/list/?submitter=89400

>   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);

Re: [RESEND PATCH] powerpc: mpic: Use str_enabled_disabled() helper function
Posted by Thorsten Blum 9 months, 3 weeks ago
Hi Christophe,

> On 24. Feb 2025, at 13:56, Christophe Leroy wrote:
> Le 19/02/2025 à 12:20, Thorsten Blum a écrit :
>> 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.
>> Reviewed-by: Ricardo B. Marlière <ricardo@marliere.net>
>> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
>> ---
> 
> When you resend a patch, please tell why here (below the ---) so that we know the reason.

A "resend" is meant as a "ping" and the patch is always unmodified.

From [1]: "Don’t add “RESEND” when you are submitting a modified version
of your patch or patch series - “RESEND” only applies to resubmission of
a patch or patch series which have not been modified in any way from the
previous submission."

When a patch is not in -next yet or when it's been a week or longer and
I haven't received any feedback, I eventually follow up on it by
resending the same patch.

You're the first one to ask for a reason for resending.

> At the time being I have several duplicated patches from you and I don't know what to do with them which one to keep and which one to drop.

They're the same - feel free to pick the original patch or the resend.

Thanks,
Thorsten

[1] https://www.kernel.org/doc/html/latest/process/submitting-patches.html#don-t-get-discouraged-or-impatient