]> git.sur5r.net Git - u-boot/blobdiff - lib/efi_selftest/efi_selftest.c
SPDX: Convert all of our single license tags to Linux Kernel style
[u-boot] / lib / efi_selftest / efi_selftest.c
index fc5ef254a1d14c1e256c2ff304f07c22cdd50614..13eb2cd60487ff20052d8d17ad297f61c44f5437 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * EFI efi_selftest
  *
  * Copyright (c) 2017 Heinrich Schuchardt <xypron.glpk@gmx.de>
- *
- * SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <efi_selftest.h>
@@ -77,20 +76,20 @@ void efi_st_exit_boot_services(void)
  */
 static int setup(struct efi_unit_test *test, unsigned int *failures)
 {
-       int ret;
-
-       if (!test->setup)
+       if (!test->setup) {
+               test->setup_ok = EFI_ST_SUCCESS;
                return EFI_ST_SUCCESS;
+       }
        efi_st_printc(EFI_LIGHTBLUE, "\nSetting up '%s'\n", test->name);
-       ret = test->setup(handle, systable);
-       if (ret != EFI_ST_SUCCESS) {
+       test->setup_ok = test->setup(handle, systable);
+       if (test->setup_ok != EFI_ST_SUCCESS) {
                efi_st_error("Setting up '%s' failed\n", test->name);
                ++*failures;
        } else {
                efi_st_printc(EFI_LIGHTGREEN,
                              "Setting up '%s' succeeded\n", test->name);
        }
-       return ret;
+       return test->setup_ok;
 }
 
 /*
@@ -200,7 +199,7 @@ void efi_st_do_tests(const u16 *testname, unsigned int phase,
                        continue;
                if (steps & EFI_ST_SETUP)
                        setup(test, failures);
-               if (steps & EFI_ST_EXECUTE)
+               if (steps & EFI_ST_EXECUTE && test->setup_ok == EFI_ST_SUCCESS)
                        execute(test, failures);
                if (steps & EFI_ST_TEARDOWN)
                        teardown(test, failures);