From nobody Tue May 21 09:28:47 2024 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=1662393489; cv=none; d=zohomail.com; s=zohoarc; b=a8O2+WqJeMPGDQEUrR0xmt0Unk5qL3/R88th6YwwV+Z6DiiqQcbzFWqABtQT9EKlnyxB/KZvsYidrklYnLWOkzCzGe0TsMEOicychQuTfOxrAMOYYFwO26FEJytzr+sT7VUSxkwar03f66YIpA51djpM4H5KymTY6uqsJkjdDCk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1662393489; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=sex/JCuLAFMN5rAx2vrQRgyUuKyggADragfaJOMq9YM=; b=EjHHJeil7FoTNsfKYUeJuz0q1qr5/1V1uorLQfNZ8vMZu9BPv9B2n7AKawB9yO0P90UKCOXgYbBYFEgCdSMwYn5X1El1zmHMUvZ56l2gCSvP/XmSlogLX8zAraAw79NQltIpOKOuj650ZOazx+rGmFrnJz6F9acIqIpaWJhn8CI= 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 1662393489407948.8692858361841; Mon, 5 Sep 2022 08:58:09 -0700 (PDT) Received: from localhost ([::1]:56542 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oVEUB-0007Wn-Kc for importer@patchew.org; Mon, 05 Sep 2022 11:58:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46520) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oVERm-0005f4-UH for qemu-devel@nongnu.org; Mon, 05 Sep 2022 11:55:39 -0400 Received: from smtp-out2.suse.de ([2001:67c:2178:6::1d]:58554) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oVERk-000526-S4 for qemu-devel@nongnu.org; Mon, 05 Sep 2022 11:55:38 -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-out2.suse.de (Postfix) with ESMTPS id B60211FA34; Mon, 5 Sep 2022 15:55:34 +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 65434139C7; Mon, 5 Sep 2022 15:55:34 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Lmr1FvYbFmOWZgAAMHmgww (envelope-from ); Mon, 05 Sep 2022 15:55:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1662393334; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=sex/JCuLAFMN5rAx2vrQRgyUuKyggADragfaJOMq9YM=; b=fCCmJoXyG63ZncDg76O6UwzkqlFf7v390VcZtELQwOyjUsa5/po1oyJbrdaGd5d+ghz5Kq 6cvj8un67VLn3bDoOu2ZVJ9S5pgqpSTHtsNYN9ahvqDyI6RHxkuzUgpHIal00VUEisb31w OWCiR8I+9PRnahKHu2WKIjWKhAgjwnw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1662393334; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=sex/JCuLAFMN5rAx2vrQRgyUuKyggADragfaJOMq9YM=; b=fjYJ9IeIIuQFWc5dDl9ZRdQWZDEE4rTS0yh2MMHB8biUVPXtquyGH9JYO9Fxj1o9b3e6Te ILZlepp3SCgNbyAQ== From: Claudio Fontana To: Paolo Bonzini , Richard Henderson 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: [RFC] module: removed unused function argument "mayfail" Date: Mon, 5 Sep 2022 17:55:32 +0200 Message-Id: <20220905155532.1824-1-cfontana@suse.de> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 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=2001:67c:2178:6::1d; envelope-from=cfontana@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1662393489889100001 Content-Type: text/plain; charset="utf-8" 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: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- 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