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