diff mbox series

[v3,2/4] mkimage: Use EFI32_HEADER_SIZE define in arm-efi case

Message ID 20190114152718.60629-3-agraf@suse.de
State Superseded
Headers show
Series arm64: Support HP Envy X2 | expand

Commit Message

Alexander Graf Jan. 14, 2019, 3:27 p.m. UTC
The efi-arm case was defining its own header size calculation, even though it's
100% identical to the common EFI32_HEADER_SIZE definition.

So let's clean it up to use the common define.

Signed-off-by: Alexander Graf <agraf@suse.de>

---
 util/mkimage.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

-- 
2.12.3


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Comments

Daniel Kiper Jan. 15, 2019, 12:28 p.m. UTC | #1
On Mon, Jan 14, 2019 at 04:27:16PM +0100, Alexander Graf wrote:
> The efi-arm case was defining its own header size calculation, even though it's

> 100% identical to the common EFI32_HEADER_SIZE definition.

>

> So let's clean it up to use the common define.

>

> Signed-off-by: Alexander Graf <agraf@suse.de>

> ---

>  util/mkimage.c | 7 +------

>  1 file changed, 1 insertion(+), 6 deletions(-)

>

> diff --git a/util/mkimage.c b/util/mkimage.c

> index 88b991764..a670db456 100644

> --- a/util/mkimage.c

> +++ b/util/mkimage.c

> @@ -602,12 +602,7 @@ static const struct grub_install_image_target_desc image_targets[] =

>        .decompressor_uncompressed_size = TARGET_NO_FIELD,

>        .decompressor_uncompressed_addr = TARGET_NO_FIELD,

>        .section_align = GRUB_PE32_SECTION_ALIGNMENT,

> -      .vaddr_offset = ALIGN_UP (GRUB_PE32_MSDOS_STUB_SIZE

> -                                + GRUB_PE32_SIGNATURE_SIZE

> -                                + sizeof (struct grub_pe32_coff_header)

> -                                + sizeof (struct grub_pe32_optional_header)

> -                                + 4 * sizeof (struct grub_pe32_section_table),

> -                                GRUB_PE32_SECTION_ALIGNMENT),

> +      .vaddr_offset = EFI32_HEADER_SIZE,

>        .pe_target = GRUB_PE32_MACHINE_ARMTHUMB_MIXED,

>        .elf_target = EM_ARM,

>      },


Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>


Daniel

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
diff mbox series

Patch

diff --git a/util/mkimage.c b/util/mkimage.c
index 88b991764..a670db456 100644
--- a/util/mkimage.c
+++ b/util/mkimage.c
@@ -602,12 +602,7 @@  static const struct grub_install_image_target_desc image_targets[] =
       .decompressor_uncompressed_size = TARGET_NO_FIELD,
       .decompressor_uncompressed_addr = TARGET_NO_FIELD,
       .section_align = GRUB_PE32_SECTION_ALIGNMENT,
-      .vaddr_offset = ALIGN_UP (GRUB_PE32_MSDOS_STUB_SIZE
-                                + GRUB_PE32_SIGNATURE_SIZE
-                                + sizeof (struct grub_pe32_coff_header)
-                                + sizeof (struct grub_pe32_optional_header)
-                                + 4 * sizeof (struct grub_pe32_section_table),
-                                GRUB_PE32_SECTION_ALIGNMENT),
+      .vaddr_offset = EFI32_HEADER_SIZE,
       .pe_target = GRUB_PE32_MACHINE_ARMTHUMB_MIXED,
       .elf_target = EM_ARM,
     },