From: Fu Wei Date: Thu, 12 Nov 2015 10:33:55 +0000 (+0100) Subject: xen_boot: Remove useless file_name_index variable. X-Git-Tag: 2.02-beta3~176 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a771a7b9f61653dbcff684e8ab62bc8e0daf5844;p=thirdparty%2Fgrub.git xen_boot: Remove useless file_name_index variable. --- diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c index fc5bb0c86..d1a218929 100644 --- a/grub-core/loader/arm64/xen_boot.c +++ b/grub-core/loader/arm64/xen_boot.c @@ -136,16 +136,10 @@ xen_boot_address_align (grub_addr_t start, grub_size_t align) return (align ? (ALIGN_UP (start, align)) : start); } -/* Parse the option of xen_module command. For now, we support - (1) --type - We also set up the type of module in this function. - If there are some "--type" options in the command line, - we make a custom compatible stream in this function. */ +/* set module type according to command name. */ static grub_err_t -set_module_type (grub_command_t cmd, struct xen_boot_binary *module, int *file_name_index) +set_module_type (grub_command_t cmd, struct xen_boot_binary *module) { - *file_name_index = 0; - if (!grub_strcmp (cmd->name, "xen_linux")) module->node_info.type = MODULE_IMAGE; else if (!grub_strcmp (cmd->name, "xen_initrd")) @@ -440,7 +434,6 @@ grub_cmd_xen_module (grub_command_t cmd, int argc, char *argv[]) { struct xen_boot_binary *module = NULL; - int file_name_index = 0; grub_file_t file = 0; if (!argc) @@ -462,8 +455,7 @@ grub_cmd_xen_module (grub_command_t cmd, int argc, char *argv[]) return grub_errno; /* process all the options and get module type */ - if (set_module_type (cmd, module, &file_name_index) != - GRUB_ERR_NONE) + if (set_module_type (cmd, module) != GRUB_ERR_NONE) goto fail; switch (module->node_info.type) { @@ -491,12 +483,11 @@ grub_cmd_xen_module (grub_command_t cmd, int argc, char *argv[]) module->name, module->node_info.compat_string, module->node_info.compat_string_size); - file = grub_file_open (argv[file_name_index]); + file = grub_file_open (argv[0]); if (!file) goto fail; - xen_boot_binary_load (module, file, argc - file_name_index, - argv + file_name_index); + xen_boot_binary_load (module, file, argc, argv); if (grub_errno == GRUB_ERR_NONE) grub_list_push (GRUB_AS_LIST_P (&module_head), GRUB_AS_LIST (module));