From nobody Mon Feb 9 20:35:22 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1663975572; cv=none; d=zohomail.com; s=zohoarc; b=Dhqdgz7JpZy3T5c810bm2Fzh/FfDxMm+rTpO/BJtD0anIUSfSyIJLHwes9tjdZeH1HJaR6JysK1GdWQHoXzL/fjpp4f94vZupOukx1SA4D+Hk2S5JhvVga7iR6R1LUns4vSzgJzw/VySJP5X8A3nat1Sv9ypnWY7NDqT4wxwIqg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663975572; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4L5t01RoSvLFc7n/IRLFdqy9eyH/xhBEeEPfT71PCJI=; b=LvNIaM+L0czvY2xb8GAVVL5OJOZ09pVAJaZ7n3RV4DtDHRAF34a/e1MPZLITxH1PA7EIaVtVBtat2oa0QyZimH9UZXArU51Mt+hlYWjcz0wqGW6zloGXV0iuP6k+KfdtBiOwpQmeSDfYwduwhUaiISEzm69WoVSz4f2SEdotaCU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1663975572683849.2245522585588; Fri, 23 Sep 2022 16:26:12 -0700 (PDT) Received: from localhost ([::1]:57020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obs3e-0000gA-MZ for importer@patchew.org; Fri, 23 Sep 2022 19:26:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obryy-00026P-HY for qemu-devel@nongnu.org; Fri, 23 Sep 2022 19:21:20 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:50740) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obryv-0007LB-IW for qemu-devel@nongnu.org; Fri, 23 Sep 2022 19:21:20 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E964521983; Fri, 23 Sep 2022 23:21:15 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9132C13A00; Fri, 23 Sep 2022 23:21:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id CAnSIWs/LmPcUwAAMHmgww (envelope-from ); Fri, 23 Sep 2022 23:21:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1663975275; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4L5t01RoSvLFc7n/IRLFdqy9eyH/xhBEeEPfT71PCJI=; b=HX3Vc/Be/NrIPzbynqPRRiR3mSilIYJ2FVSJUipqOFxUrERe7ow00Ba3ngHz0TMM/EpvHd Dw8vRClYEWIUdnBIc0wKrp4Xol5MTX7E53cgq6dSxSIoFWGU4hg6UUZ7gjric4bufpLAYk uN1a++Yb0o4i0Y2uFg0dPpEkYSZqsEI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1663975275; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4L5t01RoSvLFc7n/IRLFdqy9eyH/xhBEeEPfT71PCJI=; b=F91gy76jnW2pNkie2HC1X/OaxFh2p9V6XDiJ+5d79t9xssZvulMW+HAAdzk4EPwW6tAUBI Lw4GG10j6/cgqTCw== From: Claudio Fontana To: Paolo Bonzini , Richard Henderson , Markus Armbruster , Kevin Wolf Cc: qemu-devel@nongnu.org, dinechin@redhat.com, Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Claudio Fontana Subject: [PATCH v6 1/5] module: removed unused function argument "mayfail" Date: Sat, 24 Sep 2022 01:21:00 +0200 Message-Id: <20220923232104.28420-2-cfontana@suse.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20220923232104.28420-1-cfontana@suse.de> References: <20220923232104.28420-1-cfontana@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=195.135.220.28; envelope-from=cfontana@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @suse.de) X-ZM-MESSAGEID: 1663975573055100001 mayfail is always passed as false for every invocation throughout the progr= am. 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 Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/qemu/module.h | 8 ++++---- softmmu/qtest.c | 2 +- util/module.c | 20 +++++++++----------- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/include/qemu/module.h b/include/qemu/module.h index bd73607104..8c012bbe03 100644 --- a/include/qemu/module.h +++ b/include/qemu/module.h @@ -61,15 +61,15 @@ typedef enum { #define fuzz_target_init(function) module_init(function, \ MODULE_INIT_FUZZ_TARGET) #define migration_init(function) module_init(function, MODULE_INIT_MIGRATI= ON) -#define block_module_load_one(lib) module_load_one("block-", lib, false) -#define ui_module_load_one(lib) module_load_one("ui-", lib, false) -#define audio_module_load_one(lib) module_load_one("audio-", lib, false) +#define block_module_load_one(lib) module_load_one("block-", lib) +#define ui_module_load_one(lib) module_load_one("ui-", lib) +#define audio_module_load_one(lib) module_load_one("audio-", lib) =20 void register_module_init(void (*fn)(void), module_init_type type); void register_dso_module_init(void (*fn)(void), module_init_type type); =20 void module_call_init(module_init_type type); -bool module_load_one(const char *prefix, const char *lib_name, bool mayfai= l); +bool module_load_one(const char *prefix, const char *lib_name); void module_load_qom_one(const char *type); void module_load_qom_all(void); void module_allow_arch(const char *arch); diff --git a/softmmu/qtest.c b/softmmu/qtest.c index f8acef2628..76eb7bac56 100644 --- a/softmmu/qtest.c +++ b/softmmu/qtest.c @@ -756,7 +756,7 @@ static void qtest_process_command(CharBackend *chr, gch= ar **words) g_assert(words[1] && words[2]); =20 qtest_send_prefix(chr); - if (module_load_one(words[1], words[2], false)) { + if (module_load_one(words[1], words[2])) { qtest_sendf(chr, "OK\n"); } else { qtest_sendf(chr, "FAIL\n"); 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 *modinf= o) return true; } =20 -static int module_load_file(const char *fname, bool mayfail, bool export_s= ymbols) +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 ma= yfail, bool export_symbols } g_module =3D 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 =3D -EINVAL; goto out; } @@ -208,7 +206,7 @@ out: } #endif =20 -bool module_load_one(const char *prefix, const char *lib_name, bool mayfai= l) +bool module_load_one(const char *prefix, const char *lib_name) { bool success =3D false; =20 @@ -256,7 +254,7 @@ bool module_load_one(const char *prefix, const char *li= b_name, bool mayfail) if (strcmp(modinfo->name, module_name) =3D=3D 0) { /* we depend on other module(s) */ for (sl =3D modinfo->deps; *sl !=3D NULL; sl++) { - module_load_one("", *sl, false); + module_load_one("", *sl); } } else { for (sl =3D modinfo->deps; *sl !=3D NULL; sl++) { @@ -287,7 +285,7 @@ bool module_load_one(const char *prefix, const char *li= b_name, bool mayfail) for (i =3D 0; i < n_dirs; i++) { fname =3D g_strdup_printf("%s/%s%s", dirs[i], module_name, CONFIG_HOST_DSOSUF); - ret =3D module_load_file(fname, mayfail, export_symbols); + ret =3D module_load_file(fname, export_symbols); g_free(fname); fname =3D NULL; /* Try loading until loaded a module file */ @@ -333,7 +331,7 @@ void module_load_qom_one(const char *type) } for (sl =3D modinfo->objs; *sl !=3D NULL; sl++) { if (strcmp(type, *sl) =3D=3D 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 =3D true; } @@ -370,7 +368,7 @@ void qemu_load_module_for_opts(const char *group) } for (sl =3D modinfo->opts; *sl !=3D NULL; sl++) { if (strcmp(group, *sl) =3D=3D 0) { - module_load_one("", modinfo->name, false); + module_load_one("", modinfo->name); } } } --=20 2.26.2