[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251112143520.233870-9-yuntao.wang@linux.dev>
Date: Wed, 12 Nov 2025 22:35:18 +0800
From: Yuntao Wang <yuntao.wang@...ux.dev>
To: Rob Herring <robh@...nel.org>,
Saravana Kannan <saravanak@...gle.com>
Cc: Geert Uytterhoeven <geert+renesas@...der.be>,
Catalin Marinas <catalin.marinas@....com>,
AKASHI Takahiro <takahiro.akashi@...aro.org>,
James Morse <james.morse@....com>,
Chen Zhou <chenzhou10@...wei.com>,
Baoquan He <bhe@...hat.com>,
Zhen Lei <thunder.leizhen@...wei.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Changyuan Lyu <changyuanl@...gle.com>,
Alexander Graf <graf@...zon.com>,
"Mike Rapoport (Microsoft)" <rppt@...nel.org>,
devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
Yuntao Wang <yuntao.wang@...ux.dev>
Subject: [PATCH 08/10] of/fdt: Use dt_root_addr_size_bytes() instead of open-coding it
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@...ux.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
Powered by blists - more mailing lists