grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 09/10] commands/file: use definitions from arm/linux.h


From: Daniel Kiper
Subject: Re: [PATCH 09/10] commands/file: use definitions from arm/linux.h
Date: Thu, 15 Feb 2018 11:30:32 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Feb 01, 2018 at 06:18:57PM +0000, Leif Lindholm wrote:
> Clean up code for matching IS_ARM slightly by making use of struct
> linux_arm_kernel_header and GRUB_LINUX_ARM_MAGIC_SIGNATURE.
>
> Signed-off-by: Leif Lindholm <address@hidden>
> ---
>  grub-core/commands/file.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/grub-core/commands/file.c b/grub-core/commands/file.c
> index 63c84499b..fad191202 100644
> --- a/grub-core/commands/file.c
> +++ b/grub-core/commands/file.c
> @@ -27,6 +27,7 @@
>  #include <grub/elf.h>
>  #include <grub/xen_file.h>
>  #include <grub/efi/pe32.h>
> +#include <grub/arm/linux.h>
>  #include <grub/i386/linux.h>
>  #include <grub/xnu.h>
>  #include <grub/machoload.h>
> @@ -383,21 +384,18 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, 
> char **args)
>        }
>      case IS_ARM_LINUX:
>        {
> -     grub_uint32_t sig, sig_pi;
> -     if (grub_file_read (file, &sig_pi, 4) != 4)
> +     struct linux_arm_kernel_header lh;
> +     if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh))
>         break;
>       /* Raspberry pi.  */
> -     if (sig_pi == grub_cpu_to_le32_compile_time (0xea000006))
> +     if (lh.code0 == grub_cpu_to_le32_compile_time (0xea000006))

Could you define 0xea000006 as a constant? If you add the comment
what does it mean that will be perfect.

Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]