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;
                        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;
 
 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;
 
                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;