+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
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;
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
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++)