Skip to contentSkip to conversation

common/board_f: avoid -Wtype-limits warning

PATCH New Heinrich Schuchardt 3 participants 3 messages May 9, 2020 – May 15, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common/board_f: avoid -Wtype-limits warning

CONFIG_SYS_SDRAM_BASE maybe zero. Avoid a build warning when compiling with -Wtype-limits.

---
 common/board_f.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/board_f.c +1 -1
index 5c650f046c..cf93f70f74 100644
@@ -309,7 +309,7 @@ __weak int mach_cpu_init(void)
 /* Get the top of usable RAM */
 __weak ulong board_get_usable_ram_top(ulong total_size)
 {
-#ifdef CONFIG_SYS_SDRAM_BASE
+#if defined(CONFIG_SYS_SDRAM_BASE) && CONFIG_SYS_SDRAM_BASE > 0
 	/*
 	 * Detect whether we have so much RAM that it goes past the end of our
 	 * 32-bit address space. If so, clip the usable RAM so it doesn't.

--
2.26.2

#2 lore raw

PATCH 1/1 common/board_f: avoid -Wtype-limits warning

In reply to Heinrich Schuchardt
Quoted 5 lines · Heinrich Schuchardt

CONFIG_SYS_SDRAM_BASE maybe zero. Avoid a build warning when compiling with -Wtype-limits.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200515/454b8124/attachment.sig>