grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Optimization calculation expression of Macro


From: Daniel Kiper
Subject: Re: [PATCH] Optimization calculation expression of Macro
Date: Tue, 2 Apr 2019 12:33:16 +0200
User-agent: NeoMutt/20170113 (1.7.2)

On Mon, Apr 01, 2019 at 05:31:07AM -0400, Milo Wenxiang Niu wrote:
> From: ‘Milo Wenxiang Niu <address@hidden>
>
>           * include/grub/kernel.h: <FOR_MODULES(var)>:
>                       optimization expression that caculate next var.
> ---
>  include/grub/kernel.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/grub/kernel.h b/include/grub/kernel.h
> index 133a37c..fee7f66 100644
> --- a/include/grub/kernel.h
> +++ b/include/grub/kernel.h
> @@ -104,7 +104,7 @@ extern grub_addr_t EXPORT_VAR (grub_modbase);
>    var && (grub_addr_t) var \
>      < (grub_modbase + (((struct grub_module_info *) grub_modbase)->size));   
>  \
>    var = (struct grub_module_header *)                                        
> \
> -    (((grub_uint32_t *) var) + ((((struct grub_module_header *) var)->size + 
> sizeof (grub_addr_t) - 1) / sizeof (grub_addr_t)) * (sizeof (grub_addr_t) / 
> sizeof (grub_uint32_t))))
> +    (((grub_uint32_t *) var) +  (((struct grub_module_header *) var)->size + 
> sizeof (grub_addr_t) - 1) / sizeof (grub_uint32_t)))

I am afraid that math is wrong. So, I will no take this patch until you
explain what you did and why it is correct.

Daniel



reply via email to

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