* [PATCH] fadump: Use str_yes_no() helper in fadump_show_config()
@ 2024-12-30 21:41 Thorsten Blum
2025-01-13 13:00 ` Sourabh Jain
2025-01-13 15:09 ` Ritesh Harjani
0 siblings, 2 replies; 3+ messages in thread
From: Thorsten Blum @ 2024-12-30 21:41 UTC (permalink / raw)
To: Michael Ellerman, Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Hari Bathini, Sourabh Jain,
Ritesh Harjani (IBM), Bjorn Helgaas, Aneesh Kumar K.V (IBM)
Cc: Thorsten Blum, Baoquan He, linuxppc-dev, linux-kernel
Remove hard-coded strings by using the str_yes_no() helper function.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
arch/powerpc/kernel/fadump.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index 4b371c738213..8c531533dd3e 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -289,10 +289,8 @@ static void __init fadump_show_config(void)
if (!fw_dump.fadump_supported)
return;
- pr_debug("Fadump enabled : %s\n",
- (fw_dump.fadump_enabled ? "yes" : "no"));
- pr_debug("Dump Active : %s\n",
- (fw_dump.dump_active ? "yes" : "no"));
+ pr_debug("Fadump enabled : %s\n", str_yes_no(fw_dump.fadump_enabled));
+ pr_debug("Dump Active : %s\n", str_yes_no(fw_dump.dump_active));
pr_debug("Dump section sizes:\n");
pr_debug(" CPU state data size: %lx\n", fw_dump.cpu_state_data_size);
pr_debug(" HPTE region size : %lx\n", fw_dump.hpte_region_size);
--
2.47.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] fadump: Use str_yes_no() helper in fadump_show_config()
2024-12-30 21:41 [PATCH] fadump: Use str_yes_no() helper in fadump_show_config() Thorsten Blum
@ 2025-01-13 13:00 ` Sourabh Jain
2025-01-13 15:09 ` Ritesh Harjani
1 sibling, 0 replies; 3+ messages in thread
From: Sourabh Jain @ 2025-01-13 13:00 UTC (permalink / raw)
To: Thorsten Blum, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan, Hari Bathini,
Ritesh Harjani (IBM), Bjorn Helgaas, Aneesh Kumar K.V (IBM)
Cc: Baoquan He, linuxppc-dev, linux-kernel
On 31/12/24 03:11, Thorsten Blum wrote:
> Remove hard-coded strings by using the str_yes_no() helper function.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> arch/powerpc/kernel/fadump.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
> index 4b371c738213..8c531533dd3e 100644
> --- a/arch/powerpc/kernel/fadump.c
> +++ b/arch/powerpc/kernel/fadump.c
> @@ -289,10 +289,8 @@ static void __init fadump_show_config(void)
> if (!fw_dump.fadump_supported)
> return;
>
> - pr_debug("Fadump enabled : %s\n",
> - (fw_dump.fadump_enabled ? "yes" : "no"));
> - pr_debug("Dump Active : %s\n",
> - (fw_dump.dump_active ? "yes" : "no"));
> + pr_debug("Fadump enabled : %s\n", str_yes_no(fw_dump.fadump_enabled));
> + pr_debug("Dump Active : %s\n", str_yes_no(fw_dump.dump_active));
> pr_debug("Dump section sizes:\n");
> pr_debug(" CPU state data size: %lx\n", fw_dump.cpu_state_data_size);
> pr_debug(" HPTE region size : %lx\n", fw_dump.hpte_region_size);
Yes, it is better to use `str_yes_no()` instead of hard-coded strings.
I have also tested your patch, and everything is working fine.
Reviewed-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Thanks,
Sourabh Jain
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fadump: Use str_yes_no() helper in fadump_show_config()
2024-12-30 21:41 [PATCH] fadump: Use str_yes_no() helper in fadump_show_config() Thorsten Blum
2025-01-13 13:00 ` Sourabh Jain
@ 2025-01-13 15:09 ` Ritesh Harjani
1 sibling, 0 replies; 3+ messages in thread
From: Ritesh Harjani @ 2025-01-13 15:09 UTC (permalink / raw)
To: Thorsten Blum, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan, Hari Bathini,
Sourabh Jain, Bjorn Helgaas, Aneesh Kumar K.V (IBM)
Cc: Thorsten Blum, Baoquan He, linuxppc-dev, linux-kernel
Thorsten Blum <thorsten.blum@linux.dev> writes:
> Remove hard-coded strings by using the str_yes_no() helper function.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> arch/powerpc/kernel/fadump.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
In fadump.c file we have implicit include of string_choices.h i.e.
include/linux/seq_file.h -> linux/string_helpers.h -> linux/string_choices.h
Directly having string_choices include could be better.
#include <linux/string_choices.h>
However no hard preferences. The patch functionally looks correct to me.
Please feel free to add -
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
>
> diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
> index 4b371c738213..8c531533dd3e 100644
> --- a/arch/powerpc/kernel/fadump.c
> +++ b/arch/powerpc/kernel/fadump.c
> @@ -289,10 +289,8 @@ static void __init fadump_show_config(void)
> if (!fw_dump.fadump_supported)
> return;
>
> - pr_debug("Fadump enabled : %s\n",
> - (fw_dump.fadump_enabled ? "yes" : "no"));
> - pr_debug("Dump Active : %s\n",
> - (fw_dump.dump_active ? "yes" : "no"));
> + pr_debug("Fadump enabled : %s\n", str_yes_no(fw_dump.fadump_enabled));
> + pr_debug("Dump Active : %s\n", str_yes_no(fw_dump.dump_active));
> pr_debug("Dump section sizes:\n");
> pr_debug(" CPU state data size: %lx\n", fw_dump.cpu_state_data_size);
> pr_debug(" HPTE region size : %lx\n", fw_dump.hpte_region_size);
> --
> 2.47.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-13 15:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-30 21:41 [PATCH] fadump: Use str_yes_no() helper in fadump_show_config() Thorsten Blum
2025-01-13 13:00 ` Sourabh Jain
2025-01-13 15:09 ` Ritesh Harjani
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).