From patchwork Sat Oct 22 04:40:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13015790 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 CB66FC433FE for ; Sat, 22 Oct 2022 05:47:27 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1om6K2-0005Gb-VT; Sat, 22 Oct 2022 00:41:23 -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 1om6K1-0005GM-Ow for qemu-devel@nongnu.org; Sat, 22 Oct 2022 00:41:21 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1om6K0-0003Gl-9q for qemu-devel@nongnu.org; Sat, 22 Oct 2022 00:41:21 -0400 Received: by mail-pl1-x62c.google.com with SMTP id k9so4059809pll.11 for ; Fri, 21 Oct 2022 21:41:19 -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=Das98gInQlPFFwE5StoSWsLkf3C4gfxzgibTYprDcWo=; b=j1Gg7y3Dm6HLzNofzceZbdnx3gabTYm6Ok4jDEGVHuSh+/Po4lwbg42cGt0YZSaHs/ +x8S3a6LNM/YYAXxcXiNGyuR1A6FLC6CcPJFFeyiqe+UiNjx/uE7LuXEws/TKsb+/aS7 ueeLW37uQKrrmTbdDmDSs6kEmxGB9A2CJ11S3RZxJcrm0UFUnB4sl/1/Mdz5Z5aYkE+K 01umxiBBeHRVV0MTKNUmzgxjyxO5rvux86pvcwqUYfdokUcXjvjqqMDWXsUEsOyox16Q WBeBxJlbv1UkqYz4BqAWqQLymo8JivkX37dr09W5fAm5Te8NuO6GDQGf/OsY2qtz1g5X 4Hjg== 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=Das98gInQlPFFwE5StoSWsLkf3C4gfxzgibTYprDcWo=; b=E7EQr8EO0Ky5eVOCCLXpAg6krj4zL7Xb2xGyjjxuINcLMoo3pn42rQXSq0oKZ7RUgG Zel8Mvnr9H2OGP4zJYqPp4jlzYhmX18e2+IKqd4kzPgSOEU2p14Xl2CIK0f44q6l9FCx lnaPgynsKsfkAIW8KbYBJE1a/qp6PGnCd9JoZf5v52eypBerme/SDWsOXIhvLMsIXosa c3OFZeivow5U9JGvFnQeqRnX5o068QcO6aMEXK/4CqFi9fBuU9KJbtW+7o20JkCHIhuu aQoNbD3oJgHxBudWWMYcWjuM2PEab23gc32PfbLOKd8rXfVaG4GDg2AdfbGfUWzJgRXa GuiA== X-Gm-Message-State: ACrzQf1kW4CYo0UDteFskPGluVFSIz+M2MZuKdhLLgoeOaJJ4m9+DOgu E7kvegz1o/Kwe4flIdaB8oefjw== X-Google-Smtp-Source: AMsMyM6zQTNF2piyPYhdzuihzSO6iU4i3V22aiXTCSn6N6ylR1XZ16Gutxn13GpdZFFx2nULfV8qJg== X-Received: by 2002:a17:902:8303:b0:182:4ef1:8740 with SMTP id bd3-20020a170902830300b001824ef18740mr22439129plb.4.1666413679655; Fri, 21 Oct 2022 21:41:19 -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.41.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 21:41:18 -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 02/17] hw/i386/amd_iommu: Omit errp for pci_add_capability Date: Sat, 22 Oct 2022 13:40:38 +0900 Message-Id: <20221022044053.81650-3-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::62c; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x62c.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/i386/amd_iommu.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 725f69095b..8a88cbea0a 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1539,7 +1539,6 @@ static void amdvi_sysbus_reset(DeviceState *dev) static void amdvi_sysbus_realize(DeviceState *dev, Error **errp) { - int ret = 0; AMDVIState *s = AMD_IOMMU_DEVICE(dev); MachineState *ms = MACHINE(qdev_get_machine()); PCMachineState *pcms = PC_MACHINE(ms); @@ -1553,23 +1552,11 @@ static void amdvi_sysbus_realize(DeviceState *dev, Error **errp) if (!qdev_realize(DEVICE(&s->pci), &bus->qbus, errp)) { return; } - ret = pci_add_capability(&s->pci.dev, AMDVI_CAPAB_ID_SEC, 0, - AMDVI_CAPAB_SIZE, errp); - if (ret < 0) { - return; - } - s->capab_offset = ret; + s->capab_offset = pci_add_capability(&s->pci.dev, AMDVI_CAPAB_ID_SEC, 0, + AMDVI_CAPAB_SIZE); - ret = pci_add_capability(&s->pci.dev, PCI_CAP_ID_MSI, 0, - AMDVI_CAPAB_REG_SIZE, errp); - if (ret < 0) { - return; - } - ret = pci_add_capability(&s->pci.dev, PCI_CAP_ID_HT, 0, - AMDVI_CAPAB_REG_SIZE, errp); - if (ret < 0) { - return; - } + pci_add_capability(&s->pci.dev, PCI_CAP_ID_MSI, 0, AMDVI_CAPAB_REG_SIZE); + pci_add_capability(&s->pci.dev, PCI_CAP_ID_HT, 0, AMDVI_CAPAB_REG_SIZE); /* Pseudo address space under root PCI bus. */ x86ms->ioapic_as = amdvi_host_dma_iommu(bus, s, AMDVI_IOAPIC_SB_DEVID);