summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStefano Babic <sbabic@denx.de>2019-03-31 19:54:10 +0200
committerStefano Babic <sbabic@denx.de>2019-03-31 19:54:10 +0200
commit66c433ed4342e5761ee9b048c85fe47d31130b2e (patch)
tree60977b825765ebe490b01aae2154002eeea6a76b /lib
parent4b387deb78dcbe491c1f73fdd758f4ca3307bbbe (diff)
parentc3aef9339ce0592b06c8d44cf2eaf9e6f3713e4f (diff)
Merge branch 'master' of git://git.denx.de/u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_boottime.c6
-rw-r--r--lib/efi_loader/efi_file.c6
-rw-r--r--lib/efi_loader/efi_hii.c5
-rw-r--r--lib/efi_loader/efi_memory.c5
-rw-r--r--lib/efi_loader/efi_variable.c2
-rw-r--r--lib/efi_selftest/efi_freestanding.c11
-rw-r--r--lib/efi_selftest/efi_selftest_devicepath_util.c5
-rw-r--r--lib/efi_selftest/efi_selftest_hii.c17
-rw-r--r--lib/rsa/rsa-verify.c3
-rw-r--r--lib/time.c2
10 files changed, 31 insertions, 31 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index bd8b8a17ae7..4fc550d9f37 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -1581,10 +1581,8 @@ efi_status_t efi_setup_loaded_image(struct efi_device_path *device_path,
goto failure;
#endif
- if (info_ptr)
- *info_ptr = info;
- if (handle_ptr)
- *handle_ptr = obj;
+ *info_ptr = info;
+ *handle_ptr = obj;
return ret;
failure:
diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c
index 3a7323765bd..0483403be0d 100644
--- a/lib/efi_loader/efi_file.c
+++ b/lib/efi_loader/efi_file.c
@@ -226,7 +226,7 @@ static efi_status_t EFIAPI efi_file_open(struct efi_file_handle *file,
efi_status_t ret;
EFI_ENTRY("%p, %p, \"%ls\", %llx, %llu", file, new_handle,
- (wchar_t *)file_name, open_mode, attributes);
+ file_name, open_mode, attributes);
/* Check parameters */
if (!file || !new_handle || !file_name) {
@@ -628,6 +628,10 @@ static efi_status_t EFIAPI efi_file_flush(struct efi_file_handle *file)
}
static const struct efi_file_handle efi_file_handle_protocol = {
+ /*
+ * TODO: We currently only support EFI file protocol revision 0x00010000
+ * while UEFI specs 2.4 - 2.7 prescribe revision 0x00020000.
+ */
.rev = EFI_FILE_PROTOCOL_REVISION,
.open = efi_file_open,
.close = efi_file_close,
diff --git a/lib/efi_loader/efi_hii.c b/lib/efi_loader/efi_hii.c
index 3a966fa4dff..61b71dec621 100644
--- a/lib/efi_loader/efi_hii.c
+++ b/lib/efi_loader/efi_hii.c
@@ -227,9 +227,8 @@ out:
error:
if (stbl) {
free(stbl->language);
- if (idx > 0)
- while (--idx >= 0)
- free(stbl->strings[idx].string);
+ while (idx > 0)
+ free(stbl->strings[--idx].string);
free(stbl->strings);
}
free(stbl);
diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
index ebd2b36c03d..55622d2fb40 100644
--- a/lib/efi_loader/efi_memory.c
+++ b/lib/efi_loader/efi_memory.c
@@ -440,6 +440,7 @@ efi_status_t efi_free_pages(uint64_t memory, efi_uintn_t pages)
efi_status_t efi_allocate_pool(int pool_type, efi_uintn_t size, void **buffer)
{
efi_status_t r;
+ u64 addr;
struct efi_pool_allocation *alloc;
u64 num_pages = efi_size_in_pages(size +
sizeof(struct efi_pool_allocation));
@@ -453,9 +454,9 @@ efi_status_t efi_allocate_pool(int pool_type, efi_uintn_t size, void **buffer)
}
r = efi_allocate_pages(EFI_ALLOCATE_ANY_PAGES, pool_type, num_pages,
- (uint64_t *)&alloc);
-
+ &addr);
if (r == EFI_SUCCESS) {
+ alloc = (struct efi_pool_allocation *)(uintptr_t)addr;
alloc->num_pages = num_pages;
*buffer = alloc->data;
}
diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c
index e0d7f5736db..699f4184d93 100644
--- a/lib/efi_loader/efi_variable.c
+++ b/lib/efi_loader/efi_variable.c
@@ -335,7 +335,7 @@ efi_status_t EFIAPI efi_get_next_variable_name(efi_uintn_t *variable_name_size,
EFI_ENTRY("%p \"%ls\" %pUl", variable_name_size, variable_name, vendor);
if (!variable_name_size || !variable_name || !vendor)
- EFI_EXIT(EFI_INVALID_PARAMETER);
+ return EFI_EXIT(EFI_INVALID_PARAMETER);
if (variable_name[0]) {
/* check null-terminated string */
diff --git a/lib/efi_selftest/efi_freestanding.c b/lib/efi_selftest/efi_freestanding.c
new file mode 100644
index 00000000000..4b6c27e99fb
--- /dev/null
+++ b/lib/efi_selftest/efi_freestanding.c
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Library for freestanding binary
+ *
+ * Copyright 2019, Heinrich Schuchardt <xypron.glpk@gmx.de>
+ *
+ * GCC requires that freestanding programs provide memcpy(), memmove(),
+ * memset(), and memcmp().
+ */
+
+#include "../efi_loader/efi_freestanding.c"
diff --git a/lib/efi_selftest/efi_selftest_devicepath_util.c b/lib/efi_selftest/efi_selftest_devicepath_util.c
index 5fef5cfccd7..c846e057d35 100644
--- a/lib/efi_selftest/efi_selftest_devicepath_util.c
+++ b/lib/efi_selftest/efi_selftest_devicepath_util.c
@@ -256,11 +256,6 @@ static int execute(void)
efi_st_error("GetNextDevicePathInstance did not signal end\n");
return EFI_ST_FAILURE;
}
- ret = boottime->free_pool(dp2);
- if (ret != EFI_ST_SUCCESS) {
- efi_st_error("FreePool failed\n");
- return EFI_ST_FAILURE;
- }
/* Clean up */
ret = boottime->free_pool(dp2);
diff --git a/lib/efi_selftest/efi_selftest_hii.c b/lib/efi_selftest/efi_selftest_hii.c
index 8a0b3bc3536..f4b70f79508 100644
--- a/lib/efi_selftest/efi_selftest_hii.c
+++ b/lib/efi_selftest/efi_selftest_hii.c
@@ -783,19 +783,10 @@ static int test_hii_string_get_string(void)
goto out;
}
-#if 1
- u16 *c1, *c2;
-
- for (c1 = string, c2 = L"Japanese"; *c1 == *c2; c1++, c2++)
- ;
- if (!*c1 && !*c2)
- result = EFI_ST_SUCCESS;
- else
- result = EFI_ST_FAILURE;
-#else
- /* TODO: %ls */
- efi_st_printf("got string is %s (can be wrong)\n", string);
-#endif
+ if (efi_st_strcmp_16_8(string, "Japanese")) {
+ efi_st_error("get_string returned incorrect string\n");
+ goto out;
+ }
result = EFI_ST_SUCCESS;
diff --git a/lib/rsa/rsa-verify.c b/lib/rsa/rsa-verify.c
index 9734f6d3bd6..287fcc4d234 100644
--- a/lib/rsa/rsa-verify.c
+++ b/lib/rsa/rsa-verify.c
@@ -295,7 +295,7 @@ static int rsa_verify_key(struct image_sign_info *info,
#endif
struct checksum_algo *checksum = info->checksum;
struct padding_algo *padding = info->padding;
- int hash_len = checksum->checksum_len;
+ int hash_len;
if (!prop || !sig || !hash || !checksum)
return -EIO;
@@ -315,6 +315,7 @@ static int rsa_verify_key(struct image_sign_info *info,
}
uint8_t buf[sig_len];
+ hash_len = checksum->checksum_len;
#if !defined(USE_HOSTCC)
ret = uclass_get_device(UCLASS_MOD_EXP, 0, &mod_exp_dev);
diff --git a/lib/time.c b/lib/time.c
index 3bf678a2327..9c55da6f1b3 100644
--- a/lib/time.c
+++ b/lib/time.c
@@ -56,7 +56,7 @@ ulong timer_get_boot_us(void)
extern unsigned long __weak timer_read_counter(void);
#endif
-#ifdef CONFIG_TIMER
+#if CONFIG_IS_ENABLED(TIMER)
ulong notrace get_tbclk(void)
{
if (!gd->timer) {