From nobody Mon Apr 29 10:37:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495800071493510.21216240051956; Fri, 26 May 2017 05:01:11 -0700 (PDT) Received: from localhost ([::1]:36338 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEDvV-0000g9-Kb for importer@patchew.org; Fri, 26 May 2017 08:01:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEDuZ-00009f-IV for qemu-devel@nongnu.org; Fri, 26 May 2017 08:00:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dEDuW-00065Z-Ix for qemu-devel@nongnu.org; Fri, 26 May 2017 08:00:07 -0400 Received: from [59.151.112.132] (port=42819 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEDuW-000622-7V for qemu-devel@nongnu.org; Fri, 26 May 2017 08:00:04 -0400 Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 26 May 2017 19:59:50 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id 0249547C655B; Fri, 26 May 2017 19:59:49 +0800 (CST) Received: from maozy.g08.fujitsu.local (10.167.225.76) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 26 May 2017 19:59:48 +0800 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="19347605" From: Mao Zhongyi To: Date: Fri, 26 May 2017 19:58:32 +0800 Message-ID: <19feea44a3f4010645a1b829b504481f1b574b9a.1495797845.git.maozy.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 X-Originating-IP: [10.167.225.76] X-yoursite-MailScanner-ID: 0249547C655B.A34BA X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: maozy.fnst@cn.fujitsu.com X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 59.151.112.132 Subject: [Qemu-devel] [PATCH v2] pci: Set err to errp directly rather than through error_porpagate() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcel@redhat.com, imammedo@redhat.com, armbru@redhat.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ioh3420_interrupts_init() and its callers rp_realize() fill error message to local_err, then propagate it to errp by error_porpagate(), which's not necessary. So eliminate it and pass errp directly instead of local_err. Of course, error_propagate() also has been removed. Signed-off-by: Mao Zhongyi Reviewed-by: Eric Blake Reviewed-by: Marcel Apfelbaum --- v2: * Drop the part of wrong handling that ignored the fact that if=20 pci_qdev_realize()'s caller pass errp =3D NULL. hw/pci-bridge/ioh3420.c | 4 +--- hw/pci-bridge/pcie_root_port.c | 7 ++----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/pci-bridge/ioh3420.c b/hw/pci-bridge/ioh3420.c index da4e5bd..5f56a2f 100644 --- a/hw/pci-bridge/ioh3420.c +++ b/hw/pci-bridge/ioh3420.c @@ -64,15 +64,13 @@ static uint8_t ioh3420_aer_vector(const PCIDevice *d) static int ioh3420_interrupts_init(PCIDevice *d, Error **errp) { int rc; - Error *local_err =3D NULL; =20 rc =3D msi_init(d, IOH_EP_MSI_OFFSET, IOH_EP_MSI_NR_VECTOR, IOH_EP_MSI_SUPPORTED_FLAGS & PCI_MSI_FLAGS_64BIT, IOH_EP_MSI_SUPPORTED_FLAGS & PCI_MSI_FLAGS_MASKBIT, - &local_err); + errp); if (rc < 0) { assert(rc =3D=3D -ENOTSUP); - error_propagate(errp, local_err); } =20 return rc; diff --git a/hw/pci-bridge/pcie_root_port.c b/hw/pci-bridge/pcie_root_port.c index cf36318..9022996 100644 --- a/hw/pci-bridge/pcie_root_port.c +++ b/hw/pci-bridge/pcie_root_port.c @@ -59,7 +59,6 @@ static void rp_realize(PCIDevice *d, Error **errp) PCIDeviceClass *dc =3D PCI_DEVICE_GET_CLASS(d); PCIERootPortClass *rpc =3D PCIE_ROOT_PORT_GET_CLASS(d); int rc; - Error *local_err =3D NULL; =20 pci_config_set_interrupt_pin(d->config, 1); pci_bridge_initfn(d, TYPE_PCIE_BUS); @@ -72,9 +71,8 @@ static void rp_realize(PCIDevice *d, Error **errp) } =20 if (rpc->interrupts_init) { - rc =3D rpc->interrupts_init(d, &local_err); + rc =3D rpc->interrupts_init(d, errp); if (rc < 0) { - error_propagate(errp, local_err); goto err_bridge; } } @@ -98,9 +96,8 @@ static void rp_realize(PCIDevice *d, Error **errp) } =20 rc =3D pcie_aer_init(d, PCI_ERR_VER, rpc->aer_offset, - PCI_ERR_SIZEOF, &local_err); + PCI_ERR_SIZEOF, errp); if (rc < 0) { - error_propagate(errp, local_err); goto err; } pcie_aer_root_init(d); --=20 2.9.3