]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/loader/i386/linux.c (grub_cmd_initrd): Avoid unnecessarry
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Mon, 25 Jun 2012 15:44:36 +0000 (17:44 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Mon, 25 Jun 2012 15:44:36 +0000 (17:44 +0200)
cast between linux_kernel_header and linux_kernel_params.

ChangeLog
grub-core/loader/i386/linux.c

index c7241bb48894ee14e6e1a69645bd65fea275e756..2b229ee8d646730185696a35236dad27801d30ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-06-25  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/loader/i386/linux.c (grub_cmd_initrd): Avoid unnecessarry
+       cast between linux_kernel_header and linux_kernel_params.
+
 2012-06-25  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * include/grub/diskfilter.h (grub_raid5_recover_func_t): Use proper
index 07a9e37028d849084bcf7cf6479b11ab3d9c7115..69575592c7a3b6b613bda776721518c2dd264dfa 100644 (file)
@@ -1043,7 +1043,6 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
   grub_addr_t addr_min, addr_max;
   grub_addr_t addr;
   grub_err_t err;
-  struct linux_kernel_header *lh;
   int i;
   int nfiles = 0;
   grub_uint8_t *ptr;
@@ -1076,12 +1075,10 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
 
   initrd_pages = (page_align (size) >> 12);
 
-  lh = (struct linux_kernel_header *) &linux_params;
-
   /* Get the highest address available for the initrd.  */
-  if (grub_le_to_cpu16 (lh->version) >= 0x0203)
+  if (grub_le_to_cpu16 (linux_params.version) >= 0x0203)
     {
-      addr_max = grub_cpu_to_le32 (lh->initrd_addr_max);
+      addr_max = grub_cpu_to_le32 (linux_params.initrd_addr_max);
 
       /* XXX in reality, Linux specifies a bogus value, so
         it is necessary to make sure that ADDR_MAX does not exceed
@@ -1144,9 +1141,9 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
   grub_dprintf ("linux", "Initrd, addr=0x%x, size=0x%x\n",
                (unsigned) addr, (unsigned) size);
 
-  lh->ramdisk_image = initrd_mem_target;
-  lh->ramdisk_size = size;
-  lh->root_dev = 0x0100; /* XXX */
+  linux_params.ramdisk_image = initrd_mem_target;
+  linux_params.ramdisk_size = size;
+  linux_params.root_dev = 0x0100; /* XXX */
 
  fail:
   for (i = 0; i < nfiles; i++)