SPDX: Convert all of our single license tags to Linux Kernel style
[oweals/u-boot.git] / lib / efi / efi_stub.c
index 8b4bb4e78fecb76c8099de66468a39ff3bdb0874..3138739ee56a154a5e58d7af8a2da072d953bbd9 100644 (file)
@@ -1,8 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (c) 2015 Google, Inc
  *
- * SPDX-License-Identifier:    GPL-2.0+
- *
  * EFI information obtained here:
  * http://wiki.phoenix.com/wiki/index.php/EFI_BOOT_SERVICES
  *
@@ -21,8 +20,6 @@
 #include <linux/err.h>
 #include <linux/types.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #ifndef CONFIG_X86
 /*
  * Problem areas:
@@ -182,7 +179,7 @@ static int get_codeseg32(void)
                                << 16;
                base <<= 12;    /* 4KB granularity */
                limit <<= 12;
-               if ((desc & GDT_PRESENT) && (desc && GDT_NOTSYS) &&
+               if ((desc & GDT_PRESENT) && (desc & GDT_NOTSYS) &&
                    !(desc & GDT_LONG) && (desc & GDT_4KB) &&
                    (desc & GDT_32BIT) && (desc & GDT_CODE) &&
                    CONFIG_SYS_TEXT_BASE > base &&
@@ -277,7 +274,7 @@ efi_status_t efi_main(efi_handle_t image, struct efi_system_table *sys_table)
        struct efi_boot_services *boot = sys_table->boottime;
        struct efi_mem_desc *desc;
        struct efi_entry_memmap map;
-       ulong key, desc_size, size;
+       efi_uintn_t key, desc_size, size;
        efi_status_t ret;
        u32 version;
        int cs32;
@@ -354,9 +351,9 @@ efi_status_t efi_main(efi_handle_t image, struct efi_system_table *sys_table)
        /* The EFI UART won't work now, switch to a debug one */
        use_uart = true;
 
-       memcpy((void *)CONFIG_SYS_TEXT_BASE, _binary_u_boot_dtb_bin_start,
-              (ulong)_binary_u_boot_dtb_bin_end -
-              (ulong)_binary_u_boot_dtb_bin_start);
+       memcpy((void *)CONFIG_SYS_TEXT_BASE, _binary_u_boot_bin_start,
+              (ulong)_binary_u_boot_bin_end -
+              (ulong)_binary_u_boot_bin_start);
 
 #ifdef DEBUG
        puts("EFI table at ");