From 7210e457d5d166b4409bde402fd95a99e87cdfc5 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
Date: Fri, 9 Sep 2022 17:32:38 +0200
Subject: [PATCH] common/memsize.c: Fix get_effective_memsize() to always check
 for CONFIG_MAX_MEM_MAPPED
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

CONFIG_MAX_MEM_MAPPED when defined specifies upper memory mapped limit.
So check for it always, and not only when CONFIG_VERY_BIG_RAM is defined.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 common/memsize.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/memsize.c b/common/memsize.c
index d5d13d51bf..31884acca0 100644
--- a/common/memsize.c
+++ b/common/memsize.c
@@ -94,7 +94,7 @@ long get_ram_size(long *base, long maxsize)
 
 phys_size_t __weak get_effective_memsize(void)
 {
-#ifndef CONFIG_VERY_BIG_RAM
+#ifndef CONFIG_MAX_MEM_MAPPED
 	return gd->ram_size;
 #else
 	/* limit stack to what we can reasonable map */
-- 
2.39.5