aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Franz <roy.franz@linaro.org>2013-09-22 15:45:41 -0700
committerMark Brown <broonie@linaro.org>2014-06-16 21:18:27 +0100
commitd16b1f8461c33f7ca9d047973756566d39eb30a9 (patch)
tree91f6ed9608d58582f85e156d61a4c7d13e669960
parent1e1496d9d1e4b0460a714d618d971baa2d091ef1 (diff)
downloadlinux-linaro-stable-d16b1f8461c33f7ca9d047973756566d39eb30a9.tar.gz
efi: Fix types in EFI calls to match EFI function definitions.
EFI calls can made directly on ARM, so the function pointers are directly invoked. This allows types to be checked at compile time, so here we ensure that the parameters match the function signature. The wrappers used by x86 prevent any type checking. Correct the type of chunksize to be based on native width as specified by the EFI_FILE_PROTOCOL read() function. Signed-off-by: Roy Franz <roy.franz@linaro.org> Signed-off-by: Matt Fleming <matt.fleming@intel.com> (cherry picked from commit 6a5fe770d32811ffacefaa2a430cc067ecc7336c) Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--drivers/firmware/efi/efi-stub-helper.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/firmware/efi/efi-stub-helper.c b/drivers/firmware/efi/efi-stub-helper.c
index 5cea5d5a9a1f..4252d01089b2 100644
--- a/drivers/firmware/efi/efi-stub-helper.c
+++ b/drivers/firmware/efi/efi-stub-helper.c
@@ -324,7 +324,7 @@ static efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg,
status = efi_call_phys3(sys_table_arg->boottime->allocate_pool,
EFI_LOADER_DATA,
nr_files * sizeof(*files),
- &files);
+ (void **)&files);
if (status != EFI_SUCCESS) {
efi_printk(sys_table_arg, "Failed to alloc mem for file handle list\n");
goto fail;
@@ -375,7 +375,8 @@ static efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg,
boottime = sys_table_arg->boottime;
status = efi_call_phys3(boottime->handle_protocol,
- image->device_handle, &fs_proto, &io);
+ image->device_handle, &fs_proto,
+ (void **)&io);
if (status != EFI_SUCCESS) {
efi_printk(sys_table_arg, "Failed to handle fs_proto\n");
goto free_files;
@@ -409,7 +410,8 @@ static efi_status_t handle_cmdline_files(efi_system_table_t *sys_table_arg,
grow:
status = efi_call_phys3(sys_table_arg->boottime->allocate_pool,
- EFI_LOADER_DATA, info_sz, &info);
+ EFI_LOADER_DATA, info_sz,
+ (void **)&info);
if (status != EFI_SUCCESS) {
efi_printk(sys_table_arg, "Failed to alloc mem for file info\n");
goto close_handles;
@@ -459,18 +461,19 @@ grow:
addr = file_addr;
for (j = 0; j < nr_files; j++) {
- u64 size;
+ unsigned long size;
size = files[j].size;
while (size) {
- u64 chunksize;
+ unsigned long chunksize;
if (size > EFI_READ_CHUNK_SIZE)
chunksize = EFI_READ_CHUNK_SIZE;
else
chunksize = size;
status = efi_call_phys3(fh->read,
files[j].handle,
- &chunksize, addr);
+ &chunksize,
+ (void *)addr);
if (status != EFI_SUCCESS) {
efi_printk(sys_table_arg, "Failed to read file\n");
goto free_file_total;