Merge branch 'master' of git://git.denx.de/u-boot-socfpga
authorTom Rini <trini@konsulko.com>
Thu, 21 Mar 2019 17:11:06 +0000 (13:11 -0400)
committerTom Rini <trini@konsulko.com>
Thu, 21 Mar 2019 17:11:06 +0000 (13:11 -0400)
- ARM: socfpga: Build sfp image only for Gen5 and Arria10 devices

cmd/nvedit_efi.c
drivers/i2c/i2c-cdns.c
lib/efi_loader/efi_boottime.c
lib/efi_loader/efi_file.c
lib/efi_loader/efi_hii.c
lib/efi_loader/efi_memory.c
lib/efi_loader/efi_variable.c
lib/efi_selftest/efi_selftest_hii.c

index ca32566a6153b0226860649dec508c43f3e6db27..e65b38dbf399b9fbb22969de561b3abb2d215d04 100644 (file)
@@ -80,7 +80,6 @@ static void efi_dump_single_var(u16 *name, efi_guid_t *guid)
        printf(", DataSize = 0x%zx\n", size);
        print_hex_dump("    ", DUMP_PREFIX_OFFSET, 16, 1, data, size, true);
 
-       return;
 out:
        free(data);
 }
index 1af94d17614554cda01321f1a6626e3db234ab44..2c0301ad083a0dbc4b7146f9e3a3c640f314960b 100644 (file)
@@ -308,14 +308,10 @@ static int cdns_i2c_read_data(struct i2c_cdns_bus *i2c_bus, u32 addr, u8 *data,
 {
        u8 *cur_data = data;
        struct cdns_i2c_regs *regs = i2c_bus->regs;
-       int curr_recv_count;
+       u32 curr_recv_count;
        int updatetx, hold_quirk;
        u32 ret;
 
-       /* Check the hardware can handle the requested bytes */
-       if ((recv_count < 0))
-               return -EINVAL;
-
        curr_recv_count = recv_count;
 
        /* Check for the message size against the FIFO depth */
index bd8b8a17ae719d80be4bae933aeb18788b9bf06a..4fc550d9f376fa657c0805d6c9977bebd583f512 100644 (file)
@@ -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:
index 3a7323765bdb99318c3e326019c1b08f8bf09bad..bc715218a1b227fe1a56ac07d6f66fe674bd2986 100644 (file)
@@ -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) {
index 3a966fa4dff44af1f5480320110f1c1cd724cbed..61b71dec621b0be2bb474da55a5a6e456e6f0b25 100644 (file)
@@ -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);
index ebd2b36c03d7042700ea3a21ffa9155ef06f4fc8..55622d2fb40178652c57b8c57d5945259bf6a922 100644 (file)
@@ -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;
        }
index e0d7f5736db20cfe3d1d94c4c069d93f2edd6d98..699f4184d932c1b3870951dd7d06e43ceb659d32 100644 (file)
@@ -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 */
index 8a0b3bc3536ff3e646250cd9988bc07475784b14..f4b70f795085e8245d61d4c7afdf6c922897980c 100644 (file)
@@ -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;