Skip to contentSkip to conversation

test: fix unit test build error for crc8

PATCH In review [email protected] 2 participants 2 messages May 30, 2023 – May 31, 2023

lore
Share & tools
lore
#0 lore raw

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.

Fixes 3080ddf970b1 ("test: unit test for crc8")
---
 test/lib/test_crc8.c | 1 +
 1 file changed, 1 insertion(+)
test/lib/test_crc8.c +1 -0
index 0dac97bc5bfd..5037db806d09 100644
@@ -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
#1 lore raw
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_SDL is not defined. Include errno.h before including test/lib.h.

Fixes 3080ddf970b1 ("test: unit test for crc8")
---
  test/lib/test_crc8.c | 1 +
  1 file changed, 1 insertion(+)
test/lib/test_crc8.c +0 -0
index 0dac97bc5bfd..5037db806d09 100644

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

Fixes 67a36465216a ("sandbox: video: Fix building without SDL")

Best regards

Heinrich