[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251112143520.233870-5-yuntao.wang@linux.dev>
Date: Wed, 12 Nov 2025 22:35:14 +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 04/10] of/reserved_mem: Use dt_root_addr_size_bytes() instead of open-coding it
Use dt_root_addr_size_bytes() instead of open-coding it in
__reserved_mem_alloc_size() to improve code maintainability.
Signed-off-by: Yuntao Wang <yuntao.wang@...ux.dev>
---
drivers/of/of_reserved_mem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
index 0e6b0e7968a9..8d9139f4297f 100644
--- a/drivers/of/of_reserved_mem.c
+++ b/drivers/of/of_reserved_mem.c
@@ -401,7 +401,7 @@ static int __init __reserved_mem_alloc_in_range(phys_addr_t size,
*/
static int __init __reserved_mem_alloc_size(unsigned long node, const char *uname)
{
- int t_len = (dt_root_addr_cells + dt_root_size_cells) * sizeof(__be32);
+ int t_len = dt_root_addr_size_bytes();
phys_addr_t start = 0, end = 0;
phys_addr_t base = 0, align = 0, size;
int len;
--
2.51.0
Powered by blists - more mailing lists