|
|
a85e8e |
From f79921923422534c0e9be73dbe434f55bbb75996 Mon Sep 17 00:00:00 2001
|
|
|
a85e8e |
From: Peter Jones <pjones@redhat.com>
|
|
|
a85e8e |
Date: Tue, 14 Feb 2017 16:31:52 -0500
|
|
|
a85e8e |
Subject: [PATCH 230/260] linuxefi: minor cleanups
|
|
|
a85e8e |
|
|
|
a85e8e |
Signed-off-by: Peter Jones <pjones@redhat.com>
|
|
|
a85e8e |
---
|
|
|
a85e8e |
grub-core/loader/i386/efi/linux.c | 30 ++++++++++++++++++++----------
|
|
|
a85e8e |
1 file changed, 20 insertions(+), 10 deletions(-)
|
|
|
a85e8e |
|
|
|
a85e8e |
diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c
|
|
|
a85e8e |
index a95e29700..806031838 100644
|
|
|
a85e8e |
--- a/grub-core/loader/i386/efi/linux.c
|
|
|
a85e8e |
+++ b/grub-core/loader/i386/efi/linux.c
|
|
|
a85e8e |
@@ -61,13 +61,18 @@ grub_linuxefi_unload (void)
|
|
|
a85e8e |
grub_dl_unref (my_mod);
|
|
|
a85e8e |
loaded = 0;
|
|
|
a85e8e |
if (initrd_mem)
|
|
|
a85e8e |
- grub_efi_free_pages((grub_efi_physical_address_t)initrd_mem, BYTES_TO_PAGES(params->ramdisk_size));
|
|
|
a85e8e |
+ grub_efi_free_pages ((grub_efi_physical_address_t)(grub_addr_t)initrd_mem,
|
|
|
a85e8e |
+ BYTES_TO_PAGES(params->ramdisk_size));
|
|
|
a85e8e |
if (linux_cmdline)
|
|
|
a85e8e |
- grub_efi_free_pages((grub_efi_physical_address_t)linux_cmdline, BYTES_TO_PAGES(params->cmdline_size + 1));
|
|
|
a85e8e |
+ grub_efi_free_pages ((grub_efi_physical_address_t)(grub_addr_t)
|
|
|
a85e8e |
+ linux_cmdline,
|
|
|
a85e8e |
+ BYTES_TO_PAGES(params->cmdline_size + 1));
|
|
|
a85e8e |
if (kernel_mem)
|
|
|
a85e8e |
- grub_efi_free_pages((grub_efi_physical_address_t)kernel_mem, BYTES_TO_PAGES(kernel_size));
|
|
|
a85e8e |
+ grub_efi_free_pages ((grub_efi_physical_address_t)(grub_addr_t)kernel_mem,
|
|
|
a85e8e |
+ BYTES_TO_PAGES(kernel_size));
|
|
|
a85e8e |
if (params)
|
|
|
a85e8e |
- grub_efi_free_pages((grub_efi_physical_address_t)params, BYTES_TO_PAGES(16384));
|
|
|
a85e8e |
+ grub_efi_free_pages ((grub_efi_physical_address_t)(grub_addr_t)params,
|
|
|
a85e8e |
+ BYTES_TO_PAGES(16384));
|
|
|
a85e8e |
return GRUB_ERR_NONE;
|
|
|
a85e8e |
}
|
|
|
a85e8e |
|
|
|
a85e8e |
@@ -117,7 +122,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|
|
a85e8e |
grub_dprintf ("linuxefi", "initrd_mem = %lx\n", (unsigned long) initrd_mem);
|
|
|
a85e8e |
|
|
|
a85e8e |
params->ramdisk_size = size;
|
|
|
a85e8e |
- params->ramdisk_image = (grub_uint32_t)(grub_uint64_t) initrd_mem;
|
|
|
a85e8e |
+ params->ramdisk_image = (grub_uint32_t)(grub_addr_t) initrd_mem;
|
|
|
a85e8e |
|
|
|
a85e8e |
ptr = initrd_mem;
|
|
|
a85e8e |
|
|
|
a85e8e |
@@ -144,7 +149,8 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|
|
a85e8e |
grub_free (files);
|
|
|
a85e8e |
|
|
|
a85e8e |
if (initrd_mem && grub_errno)
|
|
|
a85e8e |
- grub_efi_free_pages((grub_efi_physical_address_t)initrd_mem, BYTES_TO_PAGES(size));
|
|
|
a85e8e |
+ grub_efi_free_pages ((grub_efi_physical_address_t)(grub_addr_t)initrd_mem,
|
|
|
a85e8e |
+ BYTES_TO_PAGES(size));
|
|
|
a85e8e |
|
|
|
a85e8e |
return grub_errno;
|
|
|
a85e8e |
}
|
|
|
a85e8e |
@@ -251,7 +257,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|
|
a85e8e |
linux_cmdline + sizeof (LINUX_IMAGE) - 1,
|
|
|
a85e8e |
lh.cmdline_size - (sizeof (LINUX_IMAGE) - 1));
|
|
|
a85e8e |
|
|
|
a85e8e |
- lh.cmd_line_ptr = (grub_uint32_t)(grub_uint64_t)linux_cmdline;
|
|
|
a85e8e |
+ lh.cmd_line_ptr = (grub_uint32_t)(grub_addr_t)linux_cmdline;
|
|
|
a85e8e |
|
|
|
a85e8e |
handover_offset = lh.handover_offset;
|
|
|
a85e8e |
|
|
|
a85e8e |
@@ -296,13 +302,17 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|
|
a85e8e |
}
|
|
|
a85e8e |
|
|
|
a85e8e |
if (linux_cmdline && !loaded)
|
|
|
a85e8e |
- grub_efi_free_pages((grub_efi_physical_address_t)linux_cmdline, BYTES_TO_PAGES(lh.cmdline_size + 1));
|
|
|
a85e8e |
+ grub_efi_free_pages ((grub_efi_physical_address_t)(grub_addr_t)
|
|
|
a85e8e |
+ linux_cmdline,
|
|
|
a85e8e |
+ BYTES_TO_PAGES(lh.cmdline_size + 1));
|
|
|
a85e8e |
|
|
|
a85e8e |
if (kernel_mem && !loaded)
|
|
|
a85e8e |
- grub_efi_free_pages((grub_efi_physical_address_t)kernel_mem, BYTES_TO_PAGES(kernel_size));
|
|
|
a85e8e |
+ grub_efi_free_pages ((grub_efi_physical_address_t)(grub_addr_t)kernel_mem,
|
|
|
a85e8e |
+ BYTES_TO_PAGES(kernel_size));
|
|
|
a85e8e |
|
|
|
a85e8e |
if (params && !loaded)
|
|
|
a85e8e |
- grub_efi_free_pages((grub_efi_physical_address_t)params, BYTES_TO_PAGES(16384));
|
|
|
a85e8e |
+ grub_efi_free_pages ((grub_efi_physical_address_t)(grub_addr_t)params,
|
|
|
a85e8e |
+ BYTES_TO_PAGES(16384));
|
|
|
a85e8e |
|
|
|
a85e8e |
return grub_errno;
|
|
|
a85e8e |
}
|
|
|
a85e8e |
--
|
|
|
a85e8e |
2.13.0
|
|
|
a85e8e |
|