test: fix unit test build error for crc8
PATCH 1/1 test: fix unit test build error for crc8
From: Emanuele Ghidoli <[email protected]>
Build fail due to ENOSYS undeclared if CONFIG_SANDBOX_SDL is not defined. Include errno.h before including test/lib.h.
--- test/lib/test_crc8.c | 1 + 1 file changed, 1 insertion(+)
test/lib/test_crc8.c +1 -0
@@ -5,6 +5,7 @@* Unit test for crc8 */ +#include <errno.h> #include <test/lib.h> #include <test/ut.h> #include <u-boot/crc.h>
Signature · 1 line
2.34.1
Quoted 16 lines · On 5/30/23 17:39, [email protected] wrote:
From: Emanuele Ghidoli <[email protected]>
Build fail due to ENOSYS undeclared if
CONFIG_SANDBOX_SDLis not defined. Includeerrno.hbefore includingtest/lib.h.Fixes 3080ddf970b1 ("test: unit test for crc8")Signed-off-by Emanuele Ghidoli <[email protected]>--- test/lib/test_crc8.c | 1 + 1 file changed, 1 insertion(+)test/lib/test_crc8.c +0
-0
test/lib/test_crc8.c line 11
Quoted 7 lines
test/lib/test_crc8.c +1
-0@@ -5,6 +5,7 @@* Unit test for crc8 */ +#include <errno.h> #include <test/lib.h> #include <test/ut.h> #include <u-boot/crc.h>
Thank you for reporting the issue. Unfortunately this patch seems to add a change in the wrong place:
For sandbox_defconfig with CONFIG_SANDBOX_SDL=n I get:
In file included from include/test/test.h:156,
from include/test/lib.h:9,
from test/lib/test_crc8.c:8:./arch/sandbox/include/asm/test.h: In function ‘sandbox_sdl_set_bpp’:
CC lib/libavb/avb_util.o./arch/sandbox/include/asm/test.h:323:17: error: ‘ENOSYS’ undeclared (first use in this function)
323 | return -ENOSYS;
| ^~~~~~./arch/sandbox/include/asm/test.h:323:17: note: each undeclared identifier is reported only once for each function it appears in
The file to fix is /arch/sandbox/include/asm/test.h which uses ENOSYS without declaring it.
Please, update your patch and add a line
Best regards
Heinrich