diff mbox series

[RESEND.] riscv: Use '%u' to format the output of 'cpu'

Message ID E4CA32D7942C8637+20240912134946.163833-1-wangyuli@uniontech.com (mailing list archive)
State Superseded
Headers show
Series [RESEND.] riscv: Use '%u' to format the output of 'cpu' | expand

Checks

Context Check Description
conchuod/vmtest-fixes-PR success PR summary
conchuod/patch-1-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh took 130.72s
conchuod/patch-1-test-2 success .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh took 1314.31s
conchuod/patch-1-test-3 success .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh took 1547.88s
conchuod/patch-1-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh took 19.60s
conchuod/patch-1-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh took 21.63s
conchuod/patch-1-test-6 success .github/scripts/patches/tests/checkpatch.sh took 0.40s
conchuod/patch-1-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh took 41.40s
conchuod/patch-1-test-8 success .github/scripts/patches/tests/header_inline.sh took 0.00s
conchuod/patch-1-test-9 success .github/scripts/patches/tests/kdoc.sh took 0.50s
conchuod/patch-1-test-10 success .github/scripts/patches/tests/module_param.sh took 0.01s
conchuod/patch-1-test-11 success .github/scripts/patches/tests/verify_fixes.sh took 0.00s
conchuod/patch-1-test-12 success .github/scripts/patches/tests/verify_signedoff.sh took 0.03s

Commit Message

WangYuli Sept. 12, 2024, 1:49 p.m. UTC
'cpu' is an unsigned integer, so its placeholder should be %u, not %d.

Suggested-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
---
 arch/riscv/kernel/cpu-hotplug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Charlie Jenkins Sept. 12, 2024, 8:37 p.m. UTC | #1
On Thu, Sep 12, 2024 at 09:49:46PM +0800, WangYuli wrote:
> 'cpu' is an unsigned integer, so its placeholder should be %u, not %d.
> 
> Suggested-by: Wentao Guan <guanwentao@uniontech.com>
> Signed-off-by: WangYuli <wangyuli@uniontech.com>
> ---
>  arch/riscv/kernel/cpu-hotplug.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/kernel/cpu-hotplug.c b/arch/riscv/kernel/cpu-hotplug.c
> index 28b58fc5ad19..a1e38ecfc8be 100644
> --- a/arch/riscv/kernel/cpu-hotplug.c
> +++ b/arch/riscv/kernel/cpu-hotplug.c
> @@ -58,7 +58,7 @@ void arch_cpuhp_cleanup_dead_cpu(unsigned int cpu)
>  	if (cpu_ops->cpu_is_stopped)
>  		ret = cpu_ops->cpu_is_stopped(cpu);
>  	if (ret)
> -		pr_warn("CPU%d may not have stopped: %d\n", cpu, ret);
> +		pr_warn("CPU%u may not have stopped: %d\n", cpu, ret);
>  }
>  
>  /*
> -- 
> 2.43.4

Thanks!

Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
Tested-by: Charlie Jenkins <charlie@rivosinc.com>

> 
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
Maciej W. Rozycki Sept. 12, 2024, 10:12 p.m. UTC | #2
On Thu, 12 Sep 2024, WangYuli wrote:

> 'cpu' is an unsigned integer, so its placeholder should be %u, not %d.

 NB the proper ISO C and POSIX term for `%u', `%d', etc. is "conversion 
specifier" rather than "placeholder".

  Maciej
WangYuli Sept. 13, 2024, 2:51 a.m. UTC | #3
On 2024/9/13 06:12, Maciej W. Rozycki wrote:

>   NB the proper ISO C and POSIX term for `%u', `%d', etc. is "conversion
> specifier" rather than "placeholder".

Thanks for pointing that out.

"conversion specifier" is much better and more professional.

>
>    Maciej
>
Thanks,
WangYuli Sept. 13, 2024, 3:11 a.m. UTC | #4
On 2024/9/13 04:37, Charlie Jenkins wrote:
> Thanks!
>
> Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
> Tested-by: Charlie Jenkins <charlie@rivosinc.com>
>
Thank Maciej W. Rozycki for his valuable input.

I have revised the commit msg (only) and resent a patch v2, with your 
Reviewed-by and Tested-by.

Link: 
https://lore.kernel.org/all/F5FDA7123183ED96+20240913030252.857482-1-wangyuli@uniontech.com/

Thanks,
diff mbox series

Patch

diff --git a/arch/riscv/kernel/cpu-hotplug.c b/arch/riscv/kernel/cpu-hotplug.c
index 28b58fc5ad19..a1e38ecfc8be 100644
--- a/arch/riscv/kernel/cpu-hotplug.c
+++ b/arch/riscv/kernel/cpu-hotplug.c
@@ -58,7 +58,7 @@  void arch_cpuhp_cleanup_dead_cpu(unsigned int cpu)
 	if (cpu_ops->cpu_is_stopped)
 		ret = cpu_ops->cpu_is_stopped(cpu);
 	if (ret)
-		pr_warn("CPU%d may not have stopped: %d\n", cpu, ret);
+		pr_warn("CPU%u may not have stopped: %d\n", cpu, ret);
 }
 
 /*