dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

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