We have plenty of stack space for this little function, but just to be safe,
round the stack pointer down instead of up. This may also reduce confusion
for later readers of the code.

Signed-off-by: Simon Glass <s...@chromium.org>
---

 common/init/global_data.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/init/global_data.c b/common/init/global_data.c
index ef055c4..d2d7baa 100644
--- a/common/init/global_data.c
+++ b/common/init/global_data.c
@@ -19,7 +19,7 @@ ulong board_init_f_mem(ulong top)
        top -= 0x40;
 
        top -= sizeof(struct global_data);
-       top = ALIGN(top, 16);
+       top = round_down(top, 16);
        gd = (struct global_data *)top;
 #if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBGENERIC_SUPPORT)
        memset((void *)gd, '\0', sizeof(*gd));
-- 
2.2.0.rc0.207.ga3a616c

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to