From nobody Tue Feb 10 06:07:42 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 ARC-Seal: i=1; a=rsa-sha256; t=1591882904; cv=none; d=zohomail.com; s=zohoarc; b=iNVcH9KXPr9hs6vkX2UIbuBuz5PkhZKtR94s/RIoOktb4Bg1pKImJsy1beF06B7MZ2qN/RZsf3WaFDdrPvHBH45b8VTbfxToIYTIl50u9O4+8+ad3kpXTB3JmvQh4C+OonzYAVfEon2MWJ10hBxp/VhAfMKBsI4BDgwZ59KikJs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591882904; 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=UKG1gbU2iNMLl9RWoI0+wrWwalfs7xcl9epiYQyUK+w=; b=OCaFuGimsNiuB0eFApl2+vrZnF+yArXNz/h9ttw2x1mnOHeYzc1rqiVha2oeXxHJOp7C6iyK8g7K4dEBZN/Gg1PxNdY4RE+LsBEglOER+HfxosqpJ8uT7bUVWYoOvO3Gqgfu7nTL5qWkpm1cxI8/bTz0NKq4RsF0B6PyauurYTI= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1591882904229372.24193945458364; Thu, 11 Jun 2020 06:41:44 -0700 (PDT) Received: from localhost ([::1]:59258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jjNSg-0006Hb-VC for importer@patchew.org; Thu, 11 Jun 2020 09:41:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jjNRP-0004Vz-Qv for qemu-devel@nongnu.org; Thu, 11 Jun 2020 09:40:23 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:39375 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jjNRO-0005sV-UV for qemu-devel@nongnu.org; Thu, 11 Jun 2020 09:40:23 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-225-FnKNYJrHPC6zL4zbAWh8AQ-1; Thu, 11 Jun 2020 09:40:14 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3B689805730; Thu, 11 Jun 2020 13:40:13 +0000 (UTC) Received: from bahia.lan (ovpn-114-202.ams2.redhat.com [10.36.114.202]) by smtp.corp.redhat.com (Postfix) with ESMTP id DEAAA19931; Thu, 11 Jun 2020 13:40:11 +0000 (UTC) X-MC-Unique: FnKNYJrHPC6zL4zbAWh8AQ-1 Subject: [PATCH v3 1/4] spapr: Simplify some warning printing paths in spapr_caps.c From: Greg Kurz To: David Gibson Date: Thu, 11 Jun 2020 15:40:11 +0200 Message-ID: <159188281098.70166.18387926536399257573.stgit@bahia.lan> In-Reply-To: <159188280345.70166.14940592691021389043.stgit@bahia.lan> References: <159188280345.70166.14940592691021389043.stgit@bahia.lan> User-Agent: StGit/0.21 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kaod.org 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: softfail client-ip=207.211.31.120; envelope-from=groug@kaod.org; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/11 08:37:10 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Vladimir Sementsov-Ogievskiy , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We obviously only want to print a warning in these cases, but this is done in a rather convoluted manner. Just use warn_report() instead. Signed-off-by: Greg Kurz Reviewed-by: Laurent Vivier Reviewed-by: Vladimir Sementsov-Ogievskiy --- hw/ppc/spapr_caps.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index efdc0dbbcfc0..0c2bc8e06e44 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -248,23 +248,18 @@ SpaprCapPossible cap_cfpc_possible =3D { static void cap_safe_cache_apply(SpaprMachineState *spapr, uint8_t val, Error **errp) { - Error *local_err =3D NULL; uint8_t kvm_val =3D kvmppc_get_cap_safe_cache(); =20 if (tcg_enabled() && val) { /* TCG only supports broken, allow other values and print a warnin= g */ - error_setg(&local_err, - "TCG doesn't support requested feature, cap-cfpc=3D%s", - cap_cfpc_possible.vals[val]); + warn_report("TCG doesn't support requested feature, cap-cfpc=3D%s", + cap_cfpc_possible.vals[val]); } else if (kvm_enabled() && (val > kvm_val)) { error_setg(errp, "Requested safe cache capability level not supported by= kvm," " try appending -machine cap-cfpc=3D%s", cap_cfpc_possible.vals[kvm_val]); } - - if (local_err !=3D NULL) - warn_report_err(local_err); } =20 SpaprCapPossible cap_sbbc_possible =3D { @@ -277,23 +272,18 @@ SpaprCapPossible cap_sbbc_possible =3D { static void cap_safe_bounds_check_apply(SpaprMachineState *spapr, uint8_t = val, Error **errp) { - Error *local_err =3D NULL; uint8_t kvm_val =3D kvmppc_get_cap_safe_bounds_check(); =20 if (tcg_enabled() && val) { /* TCG only supports broken, allow other values and print a warnin= g */ - error_setg(&local_err, - "TCG doesn't support requested feature, cap-sbbc=3D%s", - cap_sbbc_possible.vals[val]); + warn_report("TCG doesn't support requested feature, cap-sbbc=3D%s", + cap_sbbc_possible.vals[val]); } else if (kvm_enabled() && (val > kvm_val)) { error_setg(errp, "Requested safe bounds check capability level not supported by kvm," " try appending -machine cap-sbbc=3D%s", cap_sbbc_possible.vals[kvm_val]); } - - if (local_err !=3D NULL) - warn_report_err(local_err); } =20 SpaprCapPossible cap_ibs_possible =3D { @@ -309,24 +299,18 @@ SpaprCapPossible cap_ibs_possible =3D { static void cap_safe_indirect_branch_apply(SpaprMachineState *spapr, uint8_t val, Error **errp) { - Error *local_err =3D NULL; uint8_t kvm_val =3D kvmppc_get_cap_safe_indirect_branch(); =20 if (tcg_enabled() && val) { /* TCG only supports broken, allow other values and print a warnin= g */ - error_setg(&local_err, - "TCG doesn't support requested feature, cap-ibs=3D%s", - cap_ibs_possible.vals[val]); + warn_report("TCG doesn't support requested feature, cap-ibs=3D%s", + cap_ibs_possible.vals[val]); } else if (kvm_enabled() && (val > kvm_val)) { error_setg(errp, "Requested safe indirect branch capability level not supported by kvm," " try appending -machine cap-ibs=3D%s", cap_ibs_possible.vals[kvm_val]); } - - if (local_err !=3D NULL) { - warn_report_err(local_err); - } } =20 #define VALUE_DESC_TRISTATE " (broken, workaround, fixed)"