[U-Boot] [PATCH] board_f: drop 'dead code' in ram_top computation
Philipp Tomsich
philipp.tomsich at theobroma-systems.com
Fri Jul 27 09:16:30 UTC 2018
gd->ram_top is assigned to twice on consecutive lines and the compiler
won't be able to tell that the first assignment is dead (including its
r-value) due to the r-value containing a (side-effect free) function
call.
This drops the first assignment.
Signed-off-by: Philipp Tomsich <philipp.tomsich at theobroma-systems.com>
---
common/board_f.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/common/board_f.c b/common/board_f.c
index 88d7700..1b8a003 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -283,7 +283,6 @@ static int setup_dest_addr(void)
#ifdef CONFIG_SYS_SDRAM_BASE
gd->ram_base = CONFIG_SYS_SDRAM_BASE;
#endif
- gd->ram_top = gd->ram_base + get_effective_memsize();
gd->ram_top = board_get_usable_ram_top(gd->mon_len);
gd->relocaddr = gd->ram_top;
debug("Ram top: %08lX\n", (ulong)gd->ram_top);
--
2.1.4
More information about the U-Boot
mailing list