From patchwork Sat Oct 22 04:40:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13015788 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D4F8BC04A95 for ; Sat, 22 Oct 2022 05:47:07 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1om6L2-0005fz-2i; Sat, 22 Oct 2022 00:42:24 -0400 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 1om6Kx-0005f9-1V for qemu-devel@nongnu.org; Sat, 22 Oct 2022 00:42:19 -0400 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1om6Kv-0003j8-LD for qemu-devel@nongnu.org; Sat, 22 Oct 2022 00:42:18 -0400 Received: by mail-pg1-x530.google.com with SMTP id b5so4256487pgb.6 for ; Fri, 21 Oct 2022 21:42:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SbAX8umKvR/G7QIptphEmCjplY3oI9MYCnJ19Wzju+Q=; b=OkADUB1IrY2MCxnyWd3KYKjUorrXuCoDabxeVUw5gMC6JRjgrdoKA8HTReCuL6B7s1 N4qvMQm0KlgPdtgRgFCbGTvBa58XsA/pJesYXyrdGJrr+mxHGMhiIBMAf5RBXN165tGo YE/rPu8Ln2dUFiEm5sN4pTVGTdIKbCfXSuvjUXPyYKR/3wPLGZ4fKCiVAhVrZjuVkOWE ap9WY3XZAJajk7k703VHAFIzoD7pODILLc/orrpphsS4Ev6wYqt+Jybq2exTM0x6hk17 HySltwWjgBK/dajsv+WqiwaSzXjmhu8FT3pLAYDhJIyOb48OREsgiWVQlmnga3Pk061u m4Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SbAX8umKvR/G7QIptphEmCjplY3oI9MYCnJ19Wzju+Q=; b=1x2DpRtGyB7Tkv6sUBcCTFr5BtvDt7LJFZ0eu4nm1uEbtxlKJy0T6Zoetzs6vuIBu3 21h5IjTqyEqqiwgFRCaK4BgB32Pn70sqA0NJ+Lva6PqhgxfTMyi8/Gv31KyAFsObyJtt EyUpDeagnNPiQc5h3DpkE3qoTvdgun7NYyex7ieuYlWTxP2Y2SSctgQkgXSbeawQYQGe ySSSQYebr0Qd63VynBYdKc6kOkO6xbbT8zPBI2UDWVcwYhJOyytM7dSHvp8TZ9eqaJyW KXng9ynQ24P/+FmYtxDK9DAskmZM2MhT5Nou2rDHLwXMHEaMmmrXWXm3c3dRJ0jrlS+D TRkw== X-Gm-Message-State: ACrzQf0sxOMqFLLEyj3KD0K/0lzuCqVQ8vyRa0lMgu8Tn/OP1GXyi4l+ poxcP1cclJxGCxq0IIlohdMGjQ== X-Google-Smtp-Source: AMsMyM68VMce1vL1B0BW1xHT1i+mSfZ3l6VTXMFRrpVsscAZMd5+CN+vrx0+v+BMehI/2KIQRz/RDQ== X-Received: by 2002:a63:91c7:0:b0:460:156c:ded7 with SMTP id l190-20020a6391c7000000b00460156cded7mr19221692pge.298.1666413737034; Fri, 21 Oct 2022 21:42:17 -0700 (PDT) Received: from fedora.flets-east.jp ([2400:4050:c360:8200:8ae8:3c4:c0da:7419]) by smtp.gmail.com with ESMTPSA id y16-20020a17090264d000b001868d4600b8sm178049pli.158.2022.10.21.21.42.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 21:42:16 -0700 (PDT) From: Akihiko Odaki To: Cc: Alex Williamson , qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, "Michael S . Tsirkin" , Marcel Apfelbaum , Gerd Hoffmann , Paolo Bonzini , Richard Henderson , Eduardo Habkost , John Snow , Dmitry Fleytman , Jason Wang , Stefan Weil , Keith Busch , Klaus Jensen , Peter Maydell , Andrey Smirnov , Paul Burton , Aleksandar Rikalo , Yan Vugenfirer , Yuri Benditovich , Akihiko Odaki Subject: [PATCH v2 13/17] hw/pci-bridge/pcie_pci_bridge: Omit errp for pci_add_capability Date: Sat, 22 Oct 2022 13:40:49 +0900 Message-Id: <20221022044053.81650-14-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221022044053.81650-1-akihiko.odaki@daynix.com> References: <20221022044053.81650-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::530; envelope-from=akihiko.odaki@daynix.com; helo=mail-pg1-x530.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Akihiko Odaki --- hw/pci-bridge/pcie_pci_bridge.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/pci-bridge/pcie_pci_bridge.c b/hw/pci-bridge/pcie_pci_bridge.c index 99778e3e24..1b839465e7 100644 --- a/hw/pci-bridge/pcie_pci_bridge.c +++ b/hw/pci-bridge/pcie_pci_bridge.c @@ -35,7 +35,7 @@ static void pcie_pci_bridge_realize(PCIDevice *d, Error **errp) { PCIBridge *br = PCI_BRIDGE(d); PCIEPCIBridge *pcie_br = PCIE_PCI_BRIDGE_DEV(d); - int rc, pos; + int rc; pci_bridge_initfn(d, TYPE_PCI_BUS); @@ -49,12 +49,8 @@ static void pcie_pci_bridge_realize(PCIDevice *d, Error **errp) pcie_cap_init(d, 0, PCI_EXP_TYPE_PCI_BRIDGE, 0); - pos = pci_add_capability(d, PCI_CAP_ID_PM, 0, PCI_PM_SIZEOF, errp); - if (pos < 0) { - goto pm_error; - } - d->exp.pm_cap = pos; - pci_set_word(d->config + pos + PCI_PM_PMC, 0x3); + d->exp.pm_cap = pci_add_capability(d, PCI_CAP_ID_PM, 0, PCI_PM_SIZEOF); + pci_set_word(d->config + d->exp.pm_cap + PCI_PM_PMC, 0x3); pcie_cap_arifwd_init(d); pcie_cap_deverr_init(d); @@ -85,7 +81,6 @@ static void pcie_pci_bridge_realize(PCIDevice *d, Error **errp) msi_error: pcie_aer_exit(d); aer_error: -pm_error: pcie_cap_exit(d); shpc_cleanup(d, &pcie_br->shpc_bar); error: