dcavalca / rpms / grub2

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