* [PATCH] arm64: clean up a useless variable in xen_boot.c
@ 2015-11-10 4:45 fu.wei
0 siblings, 0 replies; only message in thread
From: fu.wei @ 2015-11-10 4:45 UTC (permalink / raw)
To: grub-devel, arvidjaar, phcoder
Cc: xen-devel, Ian.Campbell, stefano.stabellini, jcm, leif.lindholm,
linaro-uefi, Fu Wei
From: Fu Wei <fu.wei@linaro.org>
This patch delete "file_name_index" variable and related comment.
They are for xen_module command which has been deleted.
Signed-off-by: Fu Wei <fu.wei@linaro.org>
---
grub-core/loader/arm64/xen_boot.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c
index fc5bb0c..d1a2189 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 <the compatible stream>
- 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));
--
2.5.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-11-10 4:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-10 4:45 [PATCH] arm64: clean up a useless variable in xen_boot.c fu.wei
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.