Use dt_root_addr_size_bytes() instead of open-coding it in
early_init_dt_check_kho() to improve code maintainability.
Signed-off-by: Yuntao Wang <yuntao.wang@linux.dev>
---
drivers/of/fdt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 0f95f3b356ea..fa1703612530 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -890,14 +890,14 @@ static void __init early_init_dt_check_kho(void)
return;
p = of_get_flat_dt_prop(node, "linux,kho-fdt", &l);
- if (l != (dt_root_addr_cells + dt_root_size_cells) * sizeof(__be32))
+ if (l != dt_root_addr_size_bytes())
return;
fdt_start = dt_mem_next_cell(dt_root_addr_cells, &p);
fdt_size = dt_mem_next_cell(dt_root_addr_cells, &p);
p = of_get_flat_dt_prop(node, "linux,kho-scratch", &l);
- if (l != (dt_root_addr_cells + dt_root_size_cells) * sizeof(__be32))
+ if (l != dt_root_addr_size_bytes())
return;
scratch_start = dt_mem_next_cell(dt_root_addr_cells, &p);
--
2.51.0