grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 2/2] grub-core/loader/i386/multiboot_mbi.c: Remove dead incre


From: Glenn Washburn
Subject: Re: [PATCH 2/2] grub-core/loader/i386/multiboot_mbi.c: Remove dead increment
Date: Tue, 1 Mar 2022 01:38:17 -0600

On Mon, 28 Feb 2022 21:48:35 +0100
Elyes Haouas <ehaouas@noos.fr> wrote:

> The value stored to 'ptrdest' is never read
> 
> Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
> ---
>  grub-core/loader/i386/multiboot_mbi.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/grub-core/loader/i386/multiboot_mbi.c 
> b/grub-core/loader/i386/multiboot_mbi.c
> index a67d9d0a8..663b25cc5 100644
> --- a/grub-core/loader/i386/multiboot_mbi.c
> +++ b/grub-core/loader/i386/multiboot_mbi.c
> @@ -609,7 +609,6 @@ grub_multiboot_make_mbi (grub_uint32_t *target)
>    ptrorig += sizeof (struct grub_vbe_info_block);
>    ptrdest += sizeof (struct grub_vbe_info_block);
>    ptrorig += sizeof (struct grub_vbe_mode_info_block);
> -  ptrdest += sizeof (struct grub_vbe_mode_info_block);

I'm not familiar with this code and just did a cursory glance, but it
looks to me like none of these above 4 lines are used nor in the "if"
block above them. This begs for more investigation. It looks to me like
either there's code missing after this or this apparently useless code
wasn't removed during a refactor. Both ptrdest and ptrorig are stack
variables, so I don't think there's any magic in writing to them. What
am I missing? Until this is clarified, I don't think we should be
removing this code.

Glenn

>  #endif
>  
>  #ifdef GRUB_MACHINE_EFI



reply via email to

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