printf(", DataSize = 0x%zx\n", size);
print_hex_dump(" ", DUMP_PREFIX_OFFSET, 16, 1, data, size, true);
- return;
out:
free(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 */
goto failure;
#endif
- if (info_ptr)
- *info_ptr = info;
- if (handle_ptr)
- *handle_ptr = obj;
+ *info_ptr = info;
+ *handle_ptr = obj;
return ret;
failure:
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) {
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);
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));
}
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;
}
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 */
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;