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

From: Yuntao Wang

Date: Wed Nov 12 2025 - 09:37:57 EST


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@xxxxxxxxx>
---
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