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