[PATCH 05/10] of/fdt: Use dt_root_addr_size_bytes() instead of open-coding it

Yuntao Wang posted 10 patches 2 months, 4 weeks ago
There is a newer version of this series
[PATCH 05/10] of/fdt: Use dt_root_addr_size_bytes() instead of open-coding it
Posted by Yuntao Wang 2 months, 4 weeks ago
Use dt_root_addr_size_bytes() instead of open-coding it in
of_fdt_limit_memory() to improve code maintainability.

Signed-off-by: Yuntao Wang <yuntao.wang@linux.dev>
---
 drivers/of/fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 0edd639898a6..a1db3c9ac981 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -52,7 +52,7 @@ void __init of_fdt_limit_memory(int limit)
 	int memory;
 	int len;
 	const void *val;
-	int cell_size = sizeof(uint32_t)*(dt_root_addr_cells + dt_root_size_cells);
+	int cell_size = dt_root_addr_size_bytes();
 
 	memory = fdt_path_offset(initial_boot_params, "/memory");
 	if (memory > 0) {
-- 
2.51.0
Re: [PATCH 05/10] of/fdt: Use dt_root_addr_size_bytes() instead of open-coding it
Posted by Geert Uytterhoeven 2 months, 4 weeks ago
On Wed, 12 Nov 2025 at 15:37, Yuntao Wang <yuntao.wang@linux.dev> wrote:
> Use dt_root_addr_size_bytes() instead of open-coding it in
> of_fdt_limit_memory() to improve code maintainability.
>
> Signed-off-by: Yuntao Wang <yuntao.wang@linux.dev>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds