[PATCH] fadump: Use str_yes_no() helper in fadump_show_config()

Sourabh Jain sourabhjain at linux.ibm.com
Tue Jan 14 00:00:53 AEDT 2025




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 at 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 at linux.ibm.com>

Thanks,
Sourabh Jain


More information about the Linuxppc-dev mailing list