diff mbox series

[v4,3/6] boot: fdt: Fix tmp type in env_get_bootm_size() and rename to low

Message ID 20240326221431.55346-3-marek.vasut+renesas@mailbox.org
State Accepted
Commit 5fb569b3e3c6fcb93b8af7baf113f8f0649c5323
Delegated to: Tom Rini
Headers show
Series [v4,1/6] boot: fdt: Change type of env_get_bootm_low() to phys_addr_t | expand

Commit Message

Marek Vasut March 26, 2024, 10:13 p.m. UTC
Change type of 'tmp' variable from phys_size_t to phys_addr_t and
rename it to 'low' to better describe what the variable represents,
which is either the bootm_low address from environment or start of
DRAM address.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
---
V4: New patch
---
 boot/image-board.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/boot/image-board.c b/boot/image-board.c
index e3d63745299..13876b79026 100644
--- a/boot/image-board.c
+++ b/boot/image-board.c
@@ -125,8 +125,8 @@  phys_addr_t env_get_bootm_low(void)
 
 phys_size_t env_get_bootm_size(void)
 {
-	phys_size_t tmp, size;
-	phys_addr_t start;
+	phys_addr_t start, low;
+	phys_size_t size;
 	char *s = env_get("bootm_size");
 
 	if (s)
@@ -140,11 +140,11 @@  phys_size_t env_get_bootm_size(void)
 
 	s = env_get("bootm_low");
 	if (s)
-		tmp = simple_strtoull(s, NULL, 16);
+		low = simple_strtoull(s, NULL, 16);
 	else
-		tmp = start;
+		low = start;
 
-	return size - (tmp - start);
+	return size - (low - start);
 }
 
 phys_size_t env_get_bootm_mapsize(void)