From nobody Wed Feb 11 00:56:04 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1667264438; cv=none; d=zohomail.com; s=zohoarc; b=a5MPDRq3ffV1qMmMOFRnKh4QKhMqcfBQkKGk1OjL01fenrkwKr9dN2C4KikeIrk4JzA5b2nLN5pPiyiW1tl4hNtT+hUOjEGS2akUhZwNskFRgIAF9Vrt4IQsOh/wto8mlviHqmVLvtBYBNdsm12J02AsBCN4HQUHWqU3z8O6oeQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667264438; h=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; bh=LeDajy+wDOnHrF4VJbDnI9K6oGioqFYjvnSTZ44MAKY=; b=OmeDEbF0GlRL7LgbQFAmMyaWgx/UTRTI9/mTm4vmjQ31cFkCf398gbldU+Oq0po9cMr22ujDBAVNVtgw16kNjhH13hL/l/naEW60PKT9BQhw+iTkDn/0e1LaBVQnDn3NWx9+pqvchcktlUNp2ExQWmw1Q/nDzlfqh4I6EI3CTHU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org+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 1667264438375216.2502722240481; Mon, 31 Oct 2022 18:00:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opfdB-0004RV-CY; Mon, 31 Oct 2022 20:59:53 -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 1opfcw-0004M8-NP for qemu-devel@nongnu.org; Mon, 31 Oct 2022 20:59:39 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1opfcu-0005i2-10 for qemu-devel@nongnu.org; Mon, 31 Oct 2022 20:59:38 -0400 Received: by mail-pl1-x62f.google.com with SMTP id c2so12203551plz.11 for ; Mon, 31 Oct 2022 17:59:35 -0700 (PDT) Received: from fedora.flets-east.jp ([2400:4050:c360:8200:8ae8:3c4:c0da:7419]) by smtp.gmail.com with ESMTPSA id o9-20020aa79789000000b0056d98e359a5sm1875644pfp.165.2022.10.31.17.59.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 17:59:33 -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=LeDajy+wDOnHrF4VJbDnI9K6oGioqFYjvnSTZ44MAKY=; b=QK6XEkQeerSyByLHe9KG40tpCpw2IVl+9z0AXUGhKeFpw8bQh7Nsr6Q67CG1B1IkvQ g0q6Fzl2LTuCTATMJmbdbpa3qR+oRW8y1LoqAUtWtZmzs1rzeOARrnkuVn/e4gSTDlyt 855GIUfY4ZL3J5gAFdUh2gpWJpR1z/1N3p8M5Nd6eEzvlYbgOnsXYKppBuedRl+S64l1 o+lGAaoTFPD3I9X/ap67p1YzTM8B4Gpi74nXm3bGi9PhYyq2FopeRpkEbtUu8TXxRHvr uDdryPEE9L0QxU+CqoKbwQq96Ods3s56ls8JFExbMOye4bnUl4tUnFc89gBnUxN1CgR1 WuMQ== 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=LeDajy+wDOnHrF4VJbDnI9K6oGioqFYjvnSTZ44MAKY=; b=C/xDao34BhA0Tmazd2QKvriBi7I2fWeHXQKC5s37AgU5tl3Fksy9khgRneBa1NvPdi y7eN+5erMqGkLYy/6qer2xi1yXjfrzouKkTzqL+1I+QrmKM9ZkRswKV1IFHV31+aFlNr Izys+A3i42pu7LVeVFO+XmL1pypZpvrm1SOvxEU+bILZX7OYtsDt93YUlY4xaN2rHmZz tOdUx9jU7mKjxRE5Ir1P2ABucrrJ48dp9vG/NsOptB1/PbxPf+aLr93t9XpChhoN3J/z lrBcw1wxQqBRTaR0eY3DQi94Ri1KSItL22YEzl02xfoDvobPwLC8Jeaby4tjPkz/xMun 9ylA== X-Gm-Message-State: ACrzQf1tEIJlHeFd3A7ofDWNOm/vcGrg10rkyvP6ZZZy7B46yXao4irH xq5dztr/DyBRNpI9SeIaah1TErreKyImeBi7 X-Google-Smtp-Source: AMsMyM75MymOqHRfNOrEc9Pr3MhKVHqmLhH0KzLT7nBagw3AKu5hoT8WT7Rvc6pTc432Gk+5s81bGw== X-Received: by 2002:a17:90a:1097:b0:213:d7d3:ab8 with SMTP id c23-20020a17090a109700b00213d7d30ab8mr9681883pja.91.1667264374134; Mon, 31 Oct 2022 17:59:34 -0700 (PDT) From: Akihiko Odaki To: Cc: 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 v7 05/17] e1000e: Omit errp for pci_add_capability Date: Tue, 1 Nov 2022 09:58:47 +0900 Message-Id: <20221101005859.4198-6-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221101005859.4198-1-akihiko.odaki@daynix.com> References: <20221101005859.4198-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::62f; envelope-from=akihiko.odaki@daynix.com; helo=mail-pl1-x62f.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=unavailable 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+importer=patchew.org+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20210112.gappssmtp.com) X-ZM-MESSAGEID: 1667264439717100001 Content-Type: text/plain; charset="utf-8" Omitting errp for pci_add_capability() causes it to abort if capabilities overlap. This behavior is appropriate here because all of the capabilities set in this device are defined in the program and their overlap should not happen unless there is a programming error. Signed-off-by: Akihiko Odaki --- hw/net/e1000e.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c index ac96f7665a..e433b8f9a5 100644 --- a/hw/net/e1000e.c +++ b/hw/net/e1000e.c @@ -377,17 +377,10 @@ e1000e_gen_dsn(uint8_t *mac) (uint64_t)(mac[0]) << 56; } =20 -static int +static void e1000e_add_pm_capability(PCIDevice *pdev, uint8_t offset, uint16_t pmc) { - Error *local_err =3D NULL; - int ret =3D pci_add_capability(pdev, PCI_CAP_ID_PM, offset, - PCI_PM_SIZEOF, &local_err); - - if (local_err) { - error_report_err(local_err); - return ret; - } + pci_add_capability(pdev, PCI_CAP_ID_PM, offset, PCI_PM_SIZEOF); =20 pci_set_word(pdev->config + offset + PCI_PM_PMC, PCI_PM_CAP_VER_1_1 | @@ -400,8 +393,6 @@ e1000e_add_pm_capability(PCIDevice *pdev, uint8_t offse= t, uint16_t pmc) =20 pci_set_word(pdev->w1cmask + offset + PCI_PM_CTRL, PCI_PM_CTRL_PME_STATUS); - - return ret; } =20 static void e1000e_write_config(PCIDevice *pci_dev, uint32_t address, @@ -480,10 +471,7 @@ static void e1000e_pci_realize(PCIDevice *pci_dev, Err= or **errp) trace_e1000e_msi_init_fail(ret); } =20 - if (e1000e_add_pm_capability(pci_dev, e1000e_pmrb_offset, - PCI_PM_CAP_DSI) < 0) { - hw_error("Failed to initialize PM capability"); - } + e1000e_add_pm_capability(pci_dev, e1000e_pmrb_offset, PCI_PM_CAP_DSI); =20 if (pcie_aer_init(pci_dev, PCI_ERR_VER, e1000e_aer_offset, PCI_ERR_SIZEOF, NULL) < 0) { --=20 2.38.1