diff mbox series

[1/1] spl: Improve error message for SPL memory allocation

Message ID 20240313065315.118326-1-ycliang@andestech.com
State Accepted
Commit aeda4ccf3c60ab1ed43cc994d01fb93e39993ca1
Delegated to: Tom Rini
Headers show
Series [1/1] spl: Improve error message for SPL memory allocation | expand

Commit Message

Leo Liang March 13, 2024, 6:53 a.m. UTC
There could be two memory allocation scheme in SPL phase.
Explicitly print the corresponding error message.

Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
---
 common/spl/spl_fit.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Tom Rini March 21, 2024, 12:15 p.m. UTC | #1
On Wed, 13 Mar 2024 14:53:15 +0800, Leo Yu-Chi Liang wrote:

> There could be two memory allocation scheme in SPL phase.
> Explicitly print the corresponding error message.
> 
> 

Applied to u-boot/next, thanks!
diff mbox series

Patch

diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index 872df0c0fe..e5195d460c 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -550,7 +550,12 @@  static void *spl_get_fit_load_buffer(size_t size)
 	buf = malloc_cache_aligned(size);
 	if (!buf) {
 		pr_err("Could not get FIT buffer of %lu bytes\n", (ulong)size);
-		pr_err("\tcheck CONFIG_SPL_SYS_MALLOC_SIZE\n");
+
+		if (IS_ENABLED(CONFIG_SPL_SYS_MALLOC))
+			pr_err("\tcheck CONFIG_SPL_SYS_MALLOC_SIZE\n");
+		else
+			pr_err("\tcheck CONFIG_SPL_SYS_MALLOC_F_LEN\n");
+
 		buf = spl_get_load_buffer(0, size);
 	}
 	return buf;