loader: Drop argv[] argument in grub_initrd_load()
In the case of an error grub_initrd_load() uses argv[] to print the filename that caused the error. It is also possible to obtain the filename from the file handles and there is no need to duplicate that information in argv[], so let's drop it. Signed-off-by: Nikita Ermakov <arei@altlinux.org> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
parent
8df6e1c067
commit
5730424cb9
@ -422,7 +422,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
||||
grub_dprintf ("loader", "Loading initrd to 0x%08x\n",
|
||||
(grub_addr_t) initrd_start);
|
||||
|
||||
if (grub_initrd_load (&initrd_ctx, argv, (void *) initrd_start))
|
||||
if (grub_initrd_load (&initrd_ctx, (void *) initrd_start))
|
||||
goto fail;
|
||||
|
||||
initrd_end = initrd_start + size;
|
||||
|
||||
@ -263,7 +263,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (grub_initrd_load (&initrd_ctx, argv, initrd_mem))
|
||||
if (grub_initrd_load (&initrd_ctx, initrd_mem))
|
||||
goto fail;
|
||||
|
||||
initrd_start = (grub_addr_t) initrd_mem;
|
||||
|
||||
@ -1107,7 +1107,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
||||
initrd_mem_target = get_physical_target_address (ch);
|
||||
}
|
||||
|
||||
if (grub_initrd_load (&initrd_ctx, argv, initrd_mem))
|
||||
if (grub_initrd_load (&initrd_ctx, initrd_mem))
|
||||
goto fail;
|
||||
|
||||
grub_dprintf ("linux", "Initrd, addr=0x%x, size=0x%x\n",
|
||||
|
||||
@ -462,7 +462,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
||||
initrd_addr = get_physical_target_address (ch);
|
||||
}
|
||||
|
||||
if (grub_initrd_load (&initrd_ctx, argv, initrd_chunk))
|
||||
if (grub_initrd_load (&initrd_ctx, initrd_chunk))
|
||||
goto fail;
|
||||
|
||||
lh->ramdisk_image = initrd_addr;
|
||||
|
||||
@ -809,8 +809,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
||||
if (err)
|
||||
goto fail;
|
||||
|
||||
if (grub_initrd_load (&initrd_ctx, argv,
|
||||
get_virtual_current_address (ch)))
|
||||
if (grub_initrd_load (&initrd_ctx, get_virtual_current_address (ch)))
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
@ -563,7 +563,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
||||
grub_dprintf ("linux", "[addr=0x%lx, size=0x%lx]\n",
|
||||
(grub_uint64_t) initrd_mem, initrd_size);
|
||||
|
||||
if (grub_initrd_load (&initrd_ctx, argv, initrd_mem))
|
||||
if (grub_initrd_load (&initrd_ctx, initrd_mem))
|
||||
goto fail;
|
||||
fail:
|
||||
grub_initrd_close (&initrd_ctx);
|
||||
|
||||
@ -271,7 +271,7 @@ grub_initrd_close (struct grub_linux_initrd_context *initrd_ctx)
|
||||
|
||||
grub_err_t
|
||||
grub_initrd_load (struct grub_linux_initrd_context *initrd_ctx,
|
||||
char *argv[], void *target)
|
||||
void *target)
|
||||
{
|
||||
grub_uint8_t *ptr = target;
|
||||
int i;
|
||||
@ -317,7 +317,7 @@ grub_initrd_load (struct grub_linux_initrd_context *initrd_ctx,
|
||||
{
|
||||
if (!grub_errno)
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"),
|
||||
argv[i]);
|
||||
initrd_ctx->components[i].file->name);
|
||||
grub_initrd_close (initrd_ctx);
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
@ -452,7 +452,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
||||
initrd_dest = get_physical_target_address (ch) | 0x80000000;
|
||||
}
|
||||
|
||||
if (grub_initrd_load (&initrd_ctx, argv, initrd_src))
|
||||
if (grub_initrd_load (&initrd_ctx, initrd_src))
|
||||
goto fail;
|
||||
|
||||
#ifdef GRUB_MACHINE_MIPS_QEMU_MIPS
|
||||
|
||||
@ -349,7 +349,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
||||
|
||||
grub_dprintf ("loader", "Loading initrd at 0x%x, size 0x%x\n", addr, size);
|
||||
|
||||
if (grub_initrd_load (&initrd_ctx, argv, (void *) addr))
|
||||
if (grub_initrd_load (&initrd_ctx, (void *) addr))
|
||||
goto fail;
|
||||
|
||||
initrd_addr = addr;
|
||||
|
||||
@ -413,7 +413,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
||||
grub_dprintf ("loader", "Loading initrd at vaddr 0x%lx, paddr 0x%lx, size 0x%lx\n",
|
||||
addr, paddr, size);
|
||||
|
||||
if (grub_initrd_load (&initrd_ctx, argv, (void *) addr))
|
||||
if (grub_initrd_load (&initrd_ctx, (void *) addr))
|
||||
goto fail;
|
||||
|
||||
initrd_addr = addr;
|
||||
|
||||
@ -21,4 +21,4 @@ grub_initrd_close (struct grub_linux_initrd_context *initrd_ctx);
|
||||
|
||||
grub_err_t
|
||||
grub_initrd_load (struct grub_linux_initrd_context *initrd_ctx,
|
||||
char *argv[], void *target);
|
||||
void *target);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user