diff mbox series

test: bootdev: Do not require USB to compile test

Message ID 20230123220721.2463058-1-linus.walleij@linaro.org
State Accepted
Commit 0c1413f6d748d7bb685ad3b554edce6a9ca5c09d
Headers show
Series test: bootdev: Do not require USB to compile test | expand

Commit Message

Linus Walleij Jan. 23, 2023, 10:07 p.m. UTC
This test will block compilation of the entire test suite
on platforms without USB support. Make the extern
"usb_started" conditional on USB host or gadget and
define a dummy flag if neither is enabled.

Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 test/boot/bootdev.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Simon Glass Jan. 23, 2023, 10:25 p.m. UTC | #1
On Mon, 23 Jan 2023 at 15:07, Linus Walleij <linus.walleij@linaro.org> wrote:
>
> This test will block compilation of the entire test suite
> on platforms without USB support. Make the extern
> "usb_started" conditional on USB host or gadget and
> define a dummy flag if neither is enabled.
>
> Cc: Simon Glass <sjg@chromium.org>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  test/boot/bootdev.c | 4 ++++
>  1 file changed, 4 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>
Tom Rini Feb. 7, 2023, 4:54 p.m. UTC | #2
On Mon, Jan 23, 2023 at 11:07:21PM +0100, Linus Walleij wrote:

> This test will block compilation of the entire test suite
> on platforms without USB support. Make the extern
> "usb_started" conditional on USB host or gadget and
> define a dummy flag if neither is enabled.
> 
> Cc: Simon Glass <sjg@chromium.org>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> Reviewed-by: Simon Glass <sjg@chromium.org>

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

Patch

diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c
index 1c2a79fb1084..fa466b708184 100644
--- a/test/boot/bootdev.c
+++ b/test/boot/bootdev.c
@@ -18,7 +18,11 @@ 
 #include "bootstd_common.h"
 
 /* Allow reseting the USB-started flag */
+#if defined(CONFIG_USB_HOST) || defined(CONFIG_USB_GADGET)
 extern char usb_started;
+#else
+char usb_started;
+#endif
 
 /* Check 'bootdev list' command */
 static int bootdev_test_cmd_list(struct unit_test_state *uts)