Skip to contentSkip to conversation

loader/linux: Remove redundant code from in grub_cmd_linux()

PATCH In review Tianjia Zhang 2 participants 2 messages Jan 11, 2021 – Feb 26, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 loader/linux: Remove redundant code from in grub_cmd_linux()

preferred_address has been assigned to GRUB_LINUX_BZIMAGE_ADDR during initialization in grub_cmd_linux(). The assignment here is redundant and should be removed.

---
 grub-core/loader/i386/linux.c | 3 ---
 1 file changed, 3 deletions(-)
grub-core/loader/i386/linux.c +0 -3
index 3a06785b2..9f74a96b1 100644
@@ -751,14 +751,11 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
       prot_init_space = page_align (prot_size);
       if (relocatable)
 	preferred_address = grub_le_to_cpu64 (lh.pref_address);
-      else
-	preferred_address = GRUB_LINUX_BZIMAGE_ADDR;
     }
   else
     {
       min_align = align;
       prot_size = prot_file_size;
-      preferred_address = GRUB_LINUX_BZIMAGE_ADDR;
       /* Usually, the compression ratio is about 50%.  */
       prot_init_space = page_align (prot_size) * 3;
     }
Signature · 1 line
2.19.1.3.ge56e4f7
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Tianjia Zhang

preferred_address has been assigned to GRUB_LINUX_BZIMAGE_ADDR during initialization in grub_cmd_linux(). The assignment here is redundant and should be removed.

Daniel

Quoted 25 lines
---
 grub-core/loader/i386/linux.c | 3 ---
 1 file changed, 3 deletions(-)
grub-core/loader/i386/linux.c +0 -4
index 3a06785b2..9f74a96b1 100644
@@ -751,14 +751,11 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
       prot_init_space = page_align (prot_size);
       if (relocatable)
 	preferred_address = grub_le_to_cpu64 (lh.pref_address);
-      else
-	preferred_address = GRUB_LINUX_BZIMAGE_ADDR;
     }
   else
     {
       min_align = align;
       prot_size = prot_file_size;
-      preferred_address = GRUB_LINUX_BZIMAGE_ADDR;
       /* Usually, the compression ratio is about 50%.  */
       prot_init_space = page_align (prot_size) * 3;
     }
--

2.19.1.3.ge56e4f7