Blame SOURCES/0230-linuxefi-minor-cleanups.patch

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