From nobody Mon Feb 9 12:09: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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667991274939647.6602145465065; Wed, 9 Nov 2022 02:54:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1osiig-0002ak-DK; Wed, 09 Nov 2022 05:54:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1osiie-0002Zn-Io; Wed, 09 Nov 2022 05:54:08 -0500 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1osiid-00087O-1n; Wed, 09 Nov 2022 05:54:08 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 5155A3200AC0; Wed, 9 Nov 2022 05:54:05 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 09 Nov 2022 05:54:05 -0500 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Nov 2022 05:54:03 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1667991244; x= 1668077644; bh=+IAzk32PGmFHkoSkgyshT2NR2DSbJkmn5YKXyjqRqdU=; b=p afCYftmDvgbCMf0+bIsQlhgh/zma6DBWq3SiZk4dflwBg21/0qVgeBX1N4rm3fYk bCLxIkZtHRII4RVDgM00J+S1ccBkWjNS1LeyNOvNoQTbxN7ZxBsBjrQVrWR6gKtE v1k6EbSMK31iQd4Kl35KI/F776UcbyBH9zGKDkYyCFxkFJa+1u6wCVbcGECbOaVv GyjsCsQqab2Xek2/9bbfEFlpbVWzUs4Bc3lw5m+WM7iqWRtN5jT2Im0p05b9NXnr r1oKC8/LJT21wpOYcztVdv3jcZW7CI4DNr5vO5gyduVSJf+t4icDRWEb9ugHU691 EtIVIIkpKn9W1xkDq6G2g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1667991244; x=1668077644; bh=+IAzk32PGmFHk oSkgyshT2NR2DSbJkmn5YKXyjqRqdU=; b=dkqohzt0K4g4I2cnXJqdlsMtqPaUd nZh2WFbooIgKIPrS7qcqKrklEe2yetPI6XKpn9LJ2wfE2uVjXP5ZYjpZcPGSi1EE 87suhBwOKQRaMCeh+jnMMXEhtoSQ6KpEuvLYtwMPLZ9KzJKvcPb4Y7crNWy+ViOQ r0ZSTGfZhXSv5xapqUWU4qeDGMjM2aSKMDCyaxzypDMLi8IKOl96y5CmeIn+N4Gd H0PbNut2flw/hMRpJpkOdvmB1GsQrB0lCfPQJJfAld6/pqQX1/gGSwNxd7JufYZG dkz7qrl8uV1tkqv9yfVCAR0hby9vHV3+qpN2HNEmtGmO7vkjNC9WZ1YNA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrfedvgddvudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefmlhgruhhs ucflvghnshgvnhcuoehithhssehirhhrvghlvghvrghnthdrughkqeenucggtffrrghtth gvrhhnpeejgfeilefgieevheekueevheehkeefveegiefgheefgfejjeehffefgedujedu geenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehith hssehirhhrvghlvghvrghnthdrughk X-ME-Proxy: Feedback-ID: idc91472f:Fastmail From: Klaus Jensen To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Keith Busch , Klaus Jensen , Klaus Jensen Subject: [PATCH 2/2] hw/nvme: cleanup error reporting in nvme_init_pci() Date: Wed, 9 Nov 2022 11:53:57 +0100 Message-Id: <20221109105357.30430-3-its@irrelevant.dk> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221109105357.30430-1-its@irrelevant.dk> References: <20221109105357.30430-1-its@irrelevant.dk> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1437; i=k.jensen@samsung.com; h=from:subject; bh=/XGo2GLNnDwFQPXO5wyig+gYL4hADnXqTxx0srMHc94=; b=owJ4nAFtAZL+kA0DAAoBTeGvMW1PDekByyZiAGNrhsWigfTVyYQ9nug2E+ugZAPZSFEeGpzy9xDP k1C3G0cuJIkBMwQAAQoAHRYhBFIoM6p14tzmokdmwE3hrzFtTw3pBQJja4bFAAoJEE3hrzFtTw3pCs 0IAJT0LLtUeURGS+YfGy6cjDtrDgV96Q027u5VA2a22oeCLDfHEGapTNBiyWcaEwTFFgeeIy5Um1Pe ttneKlenj+2okou7nLiD8Ij7g0awZ8C4LzozDKy+5HRq/o9pwuq9CA4rjzMWgnE6EKC6uMccq2CYAZ Cp0P/JZdtrP41lhRP4ka+P8+BhgXjRF5eVnEQU83Ev9cNzpwUXxMlPMulKF8h4kb3njIMiWxpXPzBH jEXiFr/9KLuaQGn1oq3Elv3kLUGz7bSc1hmYZAYzZSUOaJu6SH+S3fLtHySySFr/kEjXcXF3nfAQpv PpWB4wTPJZlfcG+4DCg7O47zUF2fjbdzdgX6rN X-Developer-Key: i=k.jensen@samsung.com; a=openpgp; fpr=DDCA4D9C9EF931CC3468427263D56FC5E55DA838 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=64.147.123.20; envelope-from=its@irrelevant.dk; helo=wout4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_PASS=-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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1667991278257100001 Content-Type: text/plain; charset="utf-8" From: Klaus Jensen Replace the local Error variable with errp and ERRP_GUARD(). Signed-off-by: Klaus Jensen Reviewed-by: Markus Armbruster --- hw/nvme/ctrl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 4cc6ae753295..38eb5ec54f9d 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -7345,13 +7345,13 @@ static int nvme_add_pm_capability(PCIDevice *pci_de= v, uint8_t offset) =20 static int nvme_init_pci(NvmeCtrl *n, PCIDevice *pci_dev, Error **errp) { + ERRP_GUARD(); + uint8_t *pci_conf =3D pci_dev->config; uint64_t bar_size; unsigned msix_table_offset, msix_pba_offset; int ret; =20 - Error *err =3D NULL; - pci_conf[PCI_INTERRUPT_PIN] =3D 1; pci_config_set_prog_interface(pci_conf, 0x2); =20 @@ -7388,13 +7388,13 @@ static int nvme_init_pci(NvmeCtrl *n, PCIDevice *pc= i_dev, Error **errp) } ret =3D msix_init(pci_dev, n->params.msix_qsize, &n->bar0, 0, msix_table_offset, - &n->bar0, 0, msix_pba_offset, 0, &err); + &n->bar0, 0, msix_pba_offset, 0, errp); if (ret < 0) { if (ret =3D=3D -ENOTSUP) { - warn_report_err(err); + warn_report_err(*errp); + *errp =3D NULL; } else { - error_propagate(errp, err); - return ret; + return -1; } } =20 --=20 2.38.1