X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=lib%2Fefi_selftest%2Fefi_selftest_events.c;h=47f9f99318db32f6cb77f30e2351c28fd12ce937;hb=eae4764f1ac2f3968a5c87a17b2e894a5fe05d0b;hp=532f165d437bea27b94bd95871f4f1e5ca691ccc;hpb=e67e7249c8000d72b4c4b985fdeb3e103d65aa9e;p=oweals%2Fu-boot.git diff --git a/lib/efi_selftest/efi_selftest_events.c b/lib/efi_selftest/efi_selftest_events.c index 532f165d43..47f9f99318 100644 --- a/lib/efi_selftest/efi_selftest_events.c +++ b/lib/efi_selftest/efi_selftest_events.c @@ -1,10 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * efi_selftest_events * * Copyright (c) 2017 Heinrich Schuchardt * - * SPDX-License-Identifier: GPL-2.0+ - * * This unit test uses timer events to check the implementation * of the following boottime services: * CreateEvent, CloseEvent, WaitForEvent, CheckEvent, SetTimer. @@ -108,7 +107,7 @@ static int teardown(void) */ static int execute(void) { - unsigned long index; + efi_uintn_t index; efi_status_t ret; /* Set 10 ms timer */ @@ -142,8 +141,8 @@ static int execute(void) efi_st_error("WaitForEvent returned wrong index\n"); return EFI_ST_FAILURE; } - efi_st_printf("Notification count periodic: %u\n", timer_ticks); if (timer_ticks < 8 || timer_ticks > 12) { + efi_st_printf("Notification count periodic: %u\n", timer_ticks); efi_st_error("Incorrect timing of events\n"); return EFI_ST_FAILURE; } @@ -170,8 +169,9 @@ static int execute(void) efi_st_error("Could not wait for event\n"); return EFI_ST_FAILURE; } - efi_st_printf("Notification count single shot: %u\n", timer_ticks); if (timer_ticks != 1) { + efi_st_printf("Notification count single shot: %u\n", + timer_ticks); efi_st_error("Single shot timer failed\n"); return EFI_ST_FAILURE; } @@ -180,13 +180,14 @@ static int execute(void) efi_st_error("Could not wait for event\n"); return EFI_ST_FAILURE; } - efi_st_printf("Notification count stopped timer: %u\n", timer_ticks); if (timer_ticks != 1) { + efi_st_printf("Notification count stopped timer: %u\n", + timer_ticks); efi_st_error("Stopped timer fired\n"); return EFI_ST_FAILURE; } ret = boottime->set_timer(event_wait, EFI_TIMER_STOP, 0); - if (index != 0) { + if (ret != EFI_SUCCESS) { efi_st_error("Could not cancel timer\n"); return EFI_ST_FAILURE; }