From e5178be68678e0c010cb11d107679aa8ed96e648 Mon Sep 17 00:00:00 2001 From: Evgeny Bachinin Date: Mon, 2 Dec 2024 16:45:22 +0300 Subject: sandbox: fix bloblist_finish() linker error if BLOBLIST=n Having CONFIG_OF_EMBED=y && CONFIG_BLOBLIST=n leads to the link error: ``` ld: /tmp/ccwtRVty.ltrans0.ltrans.o: in function `state_uninit': arch/sandbox/cpu/state.c:508: undefined reference to `bloblist_finish' ``` Fixes: 1c52fcca72b ("sandbox: Write out bloblist when exiting") Signed-off-by: Evgeny Bachinin Reviewed-by: Simon Glass --- include/bloblist.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/bloblist.h b/include/bloblist.h index ff32d3fecfd..f999391f74b 100644 --- a/include/bloblist.h +++ b/include/bloblist.h @@ -357,6 +357,7 @@ int bloblist_new(ulong addr, uint size, uint flags, uint align_log2); */ int bloblist_check(ulong addr, uint size); +#if CONFIG_IS_ENABLED(BLOBLIST) /** * bloblist_finish() - Set up the bloblist for the next U-Boot part * @@ -366,6 +367,12 @@ int bloblist_check(ulong addr, uint size); * Return: 0 */ int bloblist_finish(void); +#else +static inline int bloblist_finish(void) +{ + return 0; +} +#endif /* BLOBLIST */ /** * bloblist_get_stats() - Get information about the bloblist -- cgit v1.3.1 From 844f87366e1dfcca25e46a31aca3788e2bb3a43d Mon Sep 17 00:00:00 2001 From: Evgeny Bachinin Date: Mon, 2 Dec 2024 16:45:23 +0300 Subject: test: sandbox: fix invalid_use_of_IF_ENABLED_INT if BLOBLIST=n Having CONFIG_OF_EMBED=y && CONFIG_BLOBLIST=n leads to the link error: ``` ld: /tmp/ccRVty.ltrans40.ltrans.o: in function `lib_test_is_enabled': test/lib/kconfig.c:24: undefined reference to \ `invalid_use_of_IF_ENABLED_INT' ld: test/lib/kconfig.c:26: undefined reference to \ `invalid_use_of_CONFIG_IF_ENABLED_INT' ``` Fixes: 29784d62ede ("test: Add some tests for kconfig.h") Signed-off-by: Evgeny Bachinin Reviewed-by: Simon Glass --- test/lib/kconfig.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/lib/kconfig.c b/test/lib/kconfig.c index 0c463bb794a..a3645abf946 100644 --- a/test/lib/kconfig.c +++ b/test/lib/kconfig.c @@ -21,10 +21,12 @@ static int lib_test_is_enabled(struct unit_test_state *uts) ut_asserteq(0, CONFIG_IS_ENABLED(OF_PLATDATA)); ut_asserteq(0, CONFIG_IS_ENABLED(_UNDEFINED)); - ut_asserteq(0xb000, - IF_ENABLED_INT(CONFIG_BLOBLIST_FIXED, CONFIG_BLOBLIST_ADDR)); - ut_asserteq(0xb000, - CONFIG_IF_ENABLED_INT(BLOBLIST_FIXED, BLOBLIST_ADDR)); + if (IS_ENABLED(CONFIG_BLOBLIST)) { + ut_asserteq(0xb000, IF_ENABLED_INT(CONFIG_BLOBLIST_FIXED, + CONFIG_BLOBLIST_ADDR)); + ut_asserteq(0xb000, CONFIG_IF_ENABLED_INT(BLOBLIST_FIXED, + BLOBLIST_ADDR)); + } /* * This fails if CONFIG_TEST_KCONFIG_ENABLE is not enabled, since the -- cgit v1.3.1 From 6970eeb78858478d62fc96859f29c28376f9c5e1 Mon Sep 17 00:00:00 2001 From: Evgeny Bachinin Date: Mon, 2 Dec 2024 16:45:24 +0300 Subject: test: sandbox: fix link error with do_ut_bloblist if BLOBLIST=n Having CONFIG_OF_EMBED=y && CONFIG_BLOBLIST=n leads to the link error: ``` ld: /tmp/ccwtRVty.ltrans28.ltrans.o:(.data.rel+0x4b0): undefined \ reference to `do_ut_bloblist' ``` Fixes: 6ea5df39e8d ("test: Only enable bloblist test when supported") Signed-off-by: Evgeny Bachinin Reviewed-by: Simon Glass --- test/cmd_ut.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/cmd_ut.c b/test/cmd_ut.c index 195b7ea50ac..842c2c3e7f6 100644 --- a/test/cmd_ut.c +++ b/test/cmd_ut.c @@ -104,8 +104,10 @@ static struct cmd_tbl cmd_ut_sub[] = { "", ""), #endif #ifdef CONFIG_SANDBOX +#if CONFIG_IS_ENABLED(BLOBLIST) U_BOOT_CMD_MKENT(bloblist, CONFIG_SYS_MAXARGS, 1, do_ut_bloblist, "", ""), +#endif U_BOOT_CMD_MKENT(bootm, CONFIG_SYS_MAXARGS, 1, do_ut_bootm, "", ""), #endif #ifdef CONFIG_CMD_ADDRMAP -- cgit v1.3.1 From 90856d695f2f34cf5eb74c90a8b3a6cfe4932356 Mon Sep 17 00:00:00 2001 From: Evgeny Bachinin Date: Mon, 2 Dec 2024 16:45:25 +0300 Subject: test: sandbox: fix link error with do_ut_bootm if BLOBLIST=n Having CONFIG_OF_EMBED=y && CONFIG_BLOBLIST=n leads to the link error: ``` ld: /tmp/ccwtRVty.ltrans28.ltrans.o:(.data.rel+0x4e8): undefined \ reference to `do_ut_bootm' ``` Fixes: fe158657a5b ("test: inconsistent bootm tests") Signed-off-by: Evgeny Bachinin --- test/cmd_ut.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cmd_ut.c b/test/cmd_ut.c index 842c2c3e7f6..a14dbf4ca5e 100644 --- a/test/cmd_ut.c +++ b/test/cmd_ut.c @@ -107,9 +107,9 @@ static struct cmd_tbl cmd_ut_sub[] = { #if CONFIG_IS_ENABLED(BLOBLIST) U_BOOT_CMD_MKENT(bloblist, CONFIG_SYS_MAXARGS, 1, do_ut_bloblist, "", ""), -#endif U_BOOT_CMD_MKENT(bootm, CONFIG_SYS_MAXARGS, 1, do_ut_bootm, "", ""), #endif +#endif #ifdef CONFIG_CMD_ADDRMAP U_BOOT_CMD_MKENT(addrmap, CONFIG_SYS_MAXARGS, 1, do_ut_addrmap, "", ""), #endif -- cgit v1.3.1