diff options
author | Claudio Fontana | 2022-09-29 11:30:31 +0200 |
---|---|---|
committer | Paolo Bonzini | 2022-11-06 09:48:50 +0100 |
commit | 2106106d80489fb9b10cd3ccfaec811988e797cb (patch) | |
tree | 08c696257ff6592485d5bf9b78ef8f3455cc1b9a /util | |
parent | Add missing include statement for global xml_builtin (diff) | |
download | qemu-2106106d80489fb9b10cd3ccfaec811988e797cb.tar.gz qemu-2106106d80489fb9b10cd3ccfaec811988e797cb.tar.xz qemu-2106106d80489fb9b10cd3ccfaec811988e797cb.zip |
module: removed unused function argument "mayfail"
mayfail is always passed as false for every invocation throughout the program.
It controls whether to printf or not to printf an error on
g_module_open failure.
Remove this unused argument.
Signed-off-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220929093035.4231-2-cfontana@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'util')
-rw-r--r-- | util/module.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/util/module.c b/util/module.c index 8ddb0e18f5..8563edd626 100644 --- a/util/module.c +++ b/util/module.c @@ -144,7 +144,7 @@ static bool module_check_arch(const QemuModinfo *modinfo) return true; } -static int module_load_file(const char *fname, bool mayfail, bool export_symbols) +static int module_load_file(const char *fname, bool export_symbols) { GModule *g_module; void (*sym)(void); @@ -172,10 +172,8 @@ static int module_load_file(const char *fname, bool mayfail, bool export_symbols } g_module = g_module_open(fname, flags); if (!g_module) { - if (!mayfail) { - fprintf(stderr, "Failed to open module: %s\n", - g_module_error()); - } + fprintf(stderr, "Failed to open module: %s\n", + g_module_error()); ret = -EINVAL; goto out; } @@ -208,7 +206,7 @@ out: } #endif -bool module_load_one(const char *prefix, const char *lib_name, bool mayfail) +bool module_load_one(const char *prefix, const char *lib_name) { bool success = false; @@ -256,7 +254,7 @@ bool module_load_one(const char *prefix, const char *lib_name, bool mayfail) if (strcmp(modinfo->name, module_name) == 0) { /* we depend on other module(s) */ for (sl = modinfo->deps; *sl != NULL; sl++) { - module_load_one("", *sl, false); + module_load_one("", *sl); } } else { for (sl = modinfo->deps; *sl != NULL; sl++) { @@ -287,7 +285,7 @@ bool module_load_one(const char *prefix, const char *lib_name, bool mayfail) for (i = 0; i < n_dirs; i++) { fname = g_strdup_printf("%s/%s%s", dirs[i], module_name, CONFIG_HOST_DSOSUF); - ret = module_load_file(fname, mayfail, export_symbols); + ret = module_load_file(fname, export_symbols); g_free(fname); fname = NULL; /* Try loading until loaded a module file */ @@ -333,7 +331,7 @@ void module_load_qom_one(const char *type) } for (sl = modinfo->objs; *sl != NULL; sl++) { if (strcmp(type, *sl) == 0) { - module_load_one("", modinfo->name, false); + module_load_one("", modinfo->name); } } } @@ -354,7 +352,7 @@ void module_load_qom_all(void) if (!module_check_arch(modinfo)) { continue; } - module_load_one("", modinfo->name, false); + module_load_one("", modinfo->name); } module_loaded_qom_all = true; } @@ -370,7 +368,7 @@ void qemu_load_module_for_opts(const char *group) } for (sl = modinfo->opts; *sl != NULL; sl++) { if (strcmp(group, *sl) == 0) { - module_load_one("", modinfo->name, false); + module_load_one("", modinfo->name); } } } |