lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251112143520.233870-6-yuntao.wang@linux.dev>
Date: Wed, 12 Nov 2025 22:35:15 +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 05/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
of_fdt_limit_memory() to improve code maintainability.

Signed-off-by: Yuntao Wang <yuntao.wang@...ux.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ