]> git.sur5r.net Git - u-boot/blobdiff - lib/efi_loader/efi_bootmgr.c
Merge tag 'signed-efi-next' of git://github.com/agraf/u-boot
[u-boot] / lib / efi_loader / efi_bootmgr.c
index 857d88a879ec76b7508f5ca5321f3b74eafca93e..853358ab937874051eb01f401944516061957b65 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *  EFI utils
  *
  *  Copyright (c) 2017 Rob Clark
- *
- *  SPDX-License-Identifier:     GPL-2.0+
  */
 
 #include <common.h>
@@ -71,17 +70,17 @@ static void parse_load_option(struct load_option *lo, void *ptr)
 
 /* free() the result */
 static void *get_var(u16 *name, const efi_guid_t *vendor,
-                    unsigned long *size)
+                    efi_uintn_t *size)
 {
        efi_guid_t *v = (efi_guid_t *)vendor;
        efi_status_t ret;
        void *buf = NULL;
 
        *size = 0;
-       EFI_CALL(ret = rs->get_variable((s16 *)name, v, NULL, size, buf));
+       EFI_CALL(ret = rs->get_variable(name, v, NULL, size, buf));
        if (ret == EFI_BUFFER_TOO_SMALL) {
                buf = malloc(*size);
-               EFI_CALL(ret = rs->get_variable((s16 *)name, v, NULL, size, buf));
+               EFI_CALL(ret = rs->get_variable(name, v, NULL, size, buf));
        }
 
        if (ret != EFI_SUCCESS) {
@@ -105,7 +104,7 @@ static void *try_load_entry(uint16_t n, struct efi_device_path **device_path,
        u16 varname[] = L"Boot0000";
        u16 hexmap[] = L"0123456789ABCDEF";
        void *load_option, *image = NULL;
-       unsigned long size;
+       efi_uintn_t size;
 
        varname[4] = hexmap[(n & 0xf000) >> 12];
        varname[5] = hexmap[(n & 0x0f00) >> 8];
@@ -120,11 +119,9 @@ static void *try_load_entry(uint16_t n, struct efi_device_path **device_path,
 
        if (lo.attributes & LOAD_OPTION_ACTIVE) {
                efi_status_t ret;
-               u16 *str = NULL;
 
-               debug("%s: trying to load \"%ls\" from: %ls\n", __func__,
-                     lo.label, (str = efi_dp_str(lo.file_path)));
-               efi_free_pool(str);
+               debug("%s: trying to load \"%ls\" from %pD\n",
+                     __func__, lo.label, lo.file_path);
 
                ret = efi_load_image_from_path(lo.file_path, &image);
 
@@ -150,7 +147,7 @@ void *efi_bootmgr_load(struct efi_device_path **device_path,
                       struct efi_device_path **file_path)
 {
        uint16_t *bootorder;
-       unsigned long size;
+       efi_uintn_t size;
        void *image = NULL;
        int i, num;