diff mbox series

[06/10] of/fdt: Dump __be32 array in CPU type order in of_dump_addr()

Message ID 20241206-of_core_fix-v1-6-dc28ed56bec3@quicinc.com
State Accepted
Headers show
Series of: fix bugs and improve codes | expand

Checks

Context Check Description
robh/checkpatch warning total: 0 errors, 1 warnings, 8 lines checked
robh/patch-applied fail build log

Commit Message

Zijun Hu Dec. 6, 2024, 12:52 a.m. UTC
From: Zijun Hu <quic_zijuhu@quicinc.com>

of_dump_addr() dumps __be32 array without conversion to CPU byte order
in advance, that will reduce log readability for little endian CPUs.

Fix by be32_to_cpu() conversion before dump.

Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
 drivers/of/fdt_address.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Rob Herring Dec. 9, 2024, 8:37 p.m. UTC | #1
On Fri, Dec 06, 2024 at 08:52:32AM +0800, Zijun Hu wrote:
> From: Zijun Hu <quic_zijuhu@quicinc.com>
> 
> of_dump_addr() dumps __be32 array without conversion to CPU byte order
> in advance, that will reduce log readability for little endian CPUs.
> 
> Fix by be32_to_cpu() conversion before dump.
> 
> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
> ---
>  drivers/of/fdt_address.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Rob
diff mbox series

Patch

diff --git a/drivers/of/fdt_address.c b/drivers/of/fdt_address.c
index 9804d7f067056a9437d37f0b4561d79dedcc3187..1e5311f6f1858b59b99f650bcafa55a8d11225f9 100644
--- a/drivers/of/fdt_address.c
+++ b/drivers/of/fdt_address.c
@@ -28,7 +28,7 @@  static void __init of_dump_addr(const char *s, const __be32 *addr, int na)
 {
 	pr_debug("%s", s);
 	while(na--)
-		pr_cont(" %08x", *(addr++));
+		pr_cont(" %08x", be32_to_cpu(*(addr++)));
 	pr_cont("\n");
 }
 #else