dm: pci: change bus number register setting compliant with Linux
[oweals/u-boot.git] / lib / efi_selftest / efi_selftest_tpl.c
index 5d13f3b52da90b3c2ad3b7aa04b09dabb466f0bd..ddb67ed268ba4af25f8a789d319740f46230690d 100644 (file)
@@ -26,7 +26,8 @@ static void EFIAPI notify(struct efi_event *event, void *context)
 {
        unsigned int *count = context;
 
-       ++*count;
+       if (count)
+               ++*count;
 }
 
 /*
@@ -110,7 +111,7 @@ static int teardown(void)
  */
 static int execute(void)
 {
-       unsigned long index;
+       size_t index;
        efi_status_t ret;
        UINTN old_tpl;
 
@@ -206,7 +207,7 @@ static int execute(void)
                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;
        }