Blame SOURCES/0309-grub-core-loader-i386-linux.c-Remove-useless-leftove.patch

f96e0b
From 49d00849ee5577b151e079524152f9219358588a Mon Sep 17 00:00:00 2001
f96e0b
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
f96e0b
Date: Sun, 14 Apr 2013 19:01:23 +0200
f96e0b
Subject: [PATCH 309/482] 	* grub-core/loader/i386/linux.c: Remove
f96e0b
 useless leftover pointer.
f96e0b
f96e0b
---
f96e0b
 ChangeLog                     |  4 +++
f96e0b
 grub-core/loader/i386/linux.c | 64 +++++++++++++++++++++----------------------
f96e0b
 2 files changed, 35 insertions(+), 33 deletions(-)
f96e0b
f96e0b
diff --git a/ChangeLog b/ChangeLog
f96e0b
index fc3dd51..1372be8 100644
f96e0b
--- a/ChangeLog
f96e0b
+++ b/ChangeLog
f96e0b
@@ -1,5 +1,9 @@
f96e0b
 2013-04-14  Vladimir Serbinenko  <phcoder@gmail.com>
f96e0b
 
f96e0b
+	* grub-core/loader/i386/linux.c: Remove useless leftover pointer.
f96e0b
+
f96e0b
+2013-04-14  Vladimir Serbinenko  <phcoder@gmail.com>
f96e0b
+
f96e0b
 	Move GRUB out of system area when using xorriso 1.2.9 or later.
f96e0b
 
f96e0b
 2013-04-14  Vladimir Serbinenko  <phcoder@gmail.com>
f96e0b
diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c
f96e0b
index bdfe19a..5cd074b 100644
f96e0b
--- a/grub-core/loader/i386/linux.c
f96e0b
+++ b/grub-core/loader/i386/linux.c
f96e0b
@@ -688,7 +688,6 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
f96e0b
 {
f96e0b
   grub_file_t file = 0;
f96e0b
   struct linux_kernel_header lh;
f96e0b
-  struct linux_kernel_params *params;
f96e0b
   grub_uint8_t setup_sects;
f96e0b
   grub_size_t real_size, prot_size, prot_file_size;
f96e0b
   grub_ssize_t len;
f96e0b
@@ -808,16 +807,15 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
f96e0b
 		      preferred_address))
f96e0b
     goto fail;
f96e0b
 
f96e0b
-  params = (struct linux_kernel_params *) &linux_params;
f96e0b
-  grub_memset (params, 0, sizeof (*params));
f96e0b
-  grub_memcpy (&params->setup_sects, &lh.setup_sects, sizeof (lh) - 0x1F1);
f96e0b
+  grub_memset (&linux_params, 0, sizeof (linux_params));
f96e0b
+  grub_memcpy (&linux_params.setup_sects, &lh.setup_sects, sizeof (lh) - 0x1F1);
f96e0b
 
f96e0b
-  params->code32_start = prot_mode_target + lh.code32_start - GRUB_LINUX_BZIMAGE_ADDR;
f96e0b
-  params->kernel_alignment = (1 << align);
f96e0b
-  params->ps_mouse = params->padding10 =  0;
f96e0b
+  linux_params.code32_start = prot_mode_target + lh.code32_start - GRUB_LINUX_BZIMAGE_ADDR;
f96e0b
+  linux_params.kernel_alignment = (1 << align);
f96e0b
+  linux_params.ps_mouse = linux_params.padding10 =  0;
f96e0b
 
f96e0b
-  len = sizeof (*params) - sizeof (lh);
f96e0b
-  if (grub_file_read (file, (char *) params + sizeof (lh), len) != len)
f96e0b
+  len = sizeof (linux_params) - sizeof (lh);
f96e0b
+  if (grub_file_read (file, (char *) &linux_params + sizeof (lh), len) != len)
f96e0b
     {
f96e0b
       if (!grub_errno)
f96e0b
 	grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"),
f96e0b
@@ -825,58 +823,58 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
f96e0b
       goto fail;
f96e0b
     }
f96e0b
 
f96e0b
-  params->type_of_loader = GRUB_LINUX_BOOT_LOADER_TYPE;
f96e0b
+  linux_params.type_of_loader = GRUB_LINUX_BOOT_LOADER_TYPE;
f96e0b
 
f96e0b
   /* These two are used (instead of cmd_line_ptr) by older versions of Linux,
f96e0b
      and otherwise ignored.  */
f96e0b
-  params->cl_magic = GRUB_LINUX_CL_MAGIC;
f96e0b
-  params->cl_offset = 0x1000;
f96e0b
+  linux_params.cl_magic = GRUB_LINUX_CL_MAGIC;
f96e0b
+  linux_params.cl_offset = 0x1000;
f96e0b
 
f96e0b
-  params->ramdisk_image = 0;
f96e0b
-  params->ramdisk_size = 0;
f96e0b
+  linux_params.ramdisk_image = 0;
f96e0b
+  linux_params.ramdisk_size = 0;
f96e0b
 
f96e0b
-  params->heap_end_ptr = GRUB_LINUX_HEAP_END_OFFSET;
f96e0b
-  params->loadflags |= GRUB_LINUX_FLAG_CAN_USE_HEAP;
f96e0b
+  linux_params.heap_end_ptr = GRUB_LINUX_HEAP_END_OFFSET;
f96e0b
+  linux_params.loadflags |= GRUB_LINUX_FLAG_CAN_USE_HEAP;
f96e0b
 
f96e0b
   /* These are not needed to be precise, because Linux uses these values
f96e0b
      only to raise an error when the decompression code cannot find good
f96e0b
      space.  */
f96e0b
-  params->ext_mem = ((32 * 0x100000) >> 10);
f96e0b
-  params->alt_mem = ((32 * 0x100000) >> 10);
f96e0b
+  linux_params.ext_mem = ((32 * 0x100000) >> 10);
f96e0b
+  linux_params.alt_mem = ((32 * 0x100000) >> 10);
f96e0b
 
f96e0b
   /* Ignored by Linux.  */
f96e0b
-  params->video_page = 0;
f96e0b
+  linux_params.video_page = 0;
f96e0b
 
f96e0b
   /* Only used when `video_mode == 0x7', otherwise ignored.  */
f96e0b
-  params->video_ega_bx = 0;
f96e0b
+  linux_params.video_ega_bx = 0;
f96e0b
 
f96e0b
-  params->font_size = 16; /* XXX */
f96e0b
+  linux_params.font_size = 16; /* XXX */
f96e0b
 
f96e0b
 #ifdef GRUB_MACHINE_EFI
f96e0b
 #ifdef __x86_64__
f96e0b
-  if (grub_le_to_cpu16 (params->version) < 0x0208 &&
f96e0b
+  if (grub_le_to_cpu16 (linux_params.version) < 0x0208 &&
f96e0b
       ((grub_addr_t) grub_efi_system_table >> 32) != 0)
f96e0b
     return grub_error(GRUB_ERR_BAD_OS,
f96e0b
 		      "kernel does not support 64-bit addressing");
f96e0b
 #endif
f96e0b
 
f96e0b
-  if (grub_le_to_cpu16 (params->version) >= 0x0208)
f96e0b
+  if (grub_le_to_cpu16 (linux_params.version) >= 0x0208)
f96e0b
     {
f96e0b
-      params->v0208.efi_signature = GRUB_LINUX_EFI_SIGNATURE;
f96e0b
-      params->v0208.efi_system_table = (grub_uint32_t) (unsigned long) grub_efi_system_table;
f96e0b
+      linux_params.v0208.efi_signature = GRUB_LINUX_EFI_SIGNATURE;
f96e0b
+      linux_params.v0208.efi_system_table = (grub_uint32_t) (unsigned long) grub_efi_system_table;
f96e0b
 #ifdef __x86_64__
f96e0b
-      params->v0208.efi_system_table_hi = (grub_uint32_t) ((grub_uint64_t) grub_efi_system_table >> 32);
f96e0b
+      linux_params.v0208.efi_system_table_hi = (grub_uint32_t) ((grub_uint64_t) grub_efi_system_table >> 32);
f96e0b
 #endif
f96e0b
     }
f96e0b
-  else if (grub_le_to_cpu16 (params->version) >= 0x0206)
f96e0b
+  else if (grub_le_to_cpu16 (linux_params.version) >= 0x0206)
f96e0b
     {
f96e0b
-      params->v0206.efi_signature = GRUB_LINUX_EFI_SIGNATURE;
f96e0b
-      params->v0206.efi_system_table = (grub_uint32_t) (unsigned long) grub_efi_system_table;
f96e0b
+      linux_params.v0206.efi_signature = GRUB_LINUX_EFI_SIGNATURE;
f96e0b
+      linux_params.v0206.efi_system_table = (grub_uint32_t) (unsigned long) grub_efi_system_table;
f96e0b
     }
f96e0b
-  else if (grub_le_to_cpu16 (params->version) >= 0x0204)
f96e0b
+  else if (grub_le_to_cpu16 (linux_params.version) >= 0x0204)
f96e0b
     {
f96e0b
-      params->v0204.efi_signature = GRUB_LINUX_EFI_SIGNATURE_0204;
f96e0b
-      params->v0204.efi_system_table = (grub_uint32_t) (unsigned long) grub_efi_system_table;
f96e0b
+      linux_params.v0204.efi_signature = GRUB_LINUX_EFI_SIGNATURE_0204;
f96e0b
+      linux_params.v0204.efi_system_table = (grub_uint32_t) (unsigned long) grub_efi_system_table;
f96e0b
     }
f96e0b
 #endif
f96e0b
 
f96e0b
@@ -1012,7 +1010,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
f96e0b
       }
f96e0b
     else if (grub_memcmp (argv[i], "quiet", sizeof ("quiet") - 1) == 0)
f96e0b
       {
f96e0b
-	params->loadflags |= GRUB_LINUX_FLAG_QUIET;
f96e0b
+	linux_params.loadflags |= GRUB_LINUX_FLAG_QUIET;
f96e0b
       }
f96e0b
 
f96e0b
   /* Create kernel command line.  */
f96e0b
-- 
f96e0b
1.8.2.1
f96e0b