loader/linux: Fix type error for reference variable
PATCH 1/1 loader/linux: Fix type error for reference variable
relocatable is defined as type grub_uint8_t, this is also one byte definition in linux boot protocol. by semantic definition, it is a bool type. It is not appropriate to treat it as a four bytes, this patch fix this issue.
Signed-off-by Tianjia Zhang <[email protected]>
--- grub-core/loader/i386/linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
grub-core/loader/i386/linux.c +1 -1
@@ -736,7 +736,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),for (align =0 ; align <32 ; align++)if (grub_le_to_cpu32 (lh.kernel_alignment) & (1 << align))break ; - relocatable =grub_le_to_cpu32 (lh.relocatable); + relocatable = lh.relocatable; }else {
Signature · 1 line
2.19.1.3.ge56e4f7
Quoted 6 lines · Tianjia Zhang
relocatableis defined as typegrub_uint8_t, this is also one byte definition in linux boot protocol. by semantic definition, it is a bool type. It is not appropriate to treat it as a four bytes, this patch fix this issue.Signed-off-by Tianjia Zhang <[email protected]>
Reviewed-by Daniel Kiper <[email protected]>
Daniel
Quoted 19 lines
--- grub-core/loader/i386/linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)grub-core/loader/i386/linux.c +1
-2@@ -736,7 +736,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),for (align =0 ; align <32 ; align++)if (grub_le_to_cpu32 (lh.kernel_alignment) & (1 << align))break ; - relocatable =grub_le_to_cpu32 (lh.relocatable); + relocatable = lh.relocatable; }else { --2.19.1.3.ge56e4f7