From nobody Wed Feb 11 05:12:13 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@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1667323533; cv=none; d=zohomail.com; s=zohoarc; b=bRLvlLRpSAh0z1JtRiWlfhKMb2uV/XfW8KeKV91eQSWu1Uhj6EQR67qZRWWoMy3ujBcHEfBJcordmf7pOq0NCdmm6iAF7JJ3w+WChh5Mr43y5YjFVJdsUjqYyzw62L1zTvThfr2Kcvk7yyk9mxtXyzOnpU3PgHDuvXx8jg9Pymc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667323533; 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=jJjPRo2jnYNBTT+kAOkS5uMVCK0dMEO9iW4TvwZKw3A=; b=L+VoSQT5qa58eUPSHoUfgHEpiamY9Iu1Zd6Ur7JOKpUcB4TLpqT21b6BOZS5DmrszidUPcX6+XQN0NWBqEzFD0CUapKI0mEyPJOxcmrx3TgP11HN7Ep/IFhcxsrI6vNQyR/d9+a0qsWGhgOiTIRYNPJhBqeeHC8y116znH9hcFU= 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@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1667323533763879.177966665873; Tue, 1 Nov 2022 10:25:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oprme-0005ne-32; Tue, 01 Nov 2022 09:58:28 -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 1oprma-0005mq-9u for qemu-devel@nongnu.org; Tue, 01 Nov 2022 09:58:26 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oprmY-0003th-0U for qemu-devel@nongnu.org; Tue, 01 Nov 2022 09:58:24 -0400 Received: by mail-pj1-x102a.google.com with SMTP id b1-20020a17090a7ac100b00213fde52d49so3293319pjl.3 for ; Tue, 01 Nov 2022 06:58:21 -0700 (PDT) Received: from fedora.flets-east.jp ([2400:4050:c360:8200:8ae8:3c4:c0da:7419]) by smtp.gmail.com with ESMTPSA id y4-20020aa79ae4000000b0056bdc3f5b29sm6510722pfp.186.2022.11.01.06.58.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Nov 2022 06:58: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=jJjPRo2jnYNBTT+kAOkS5uMVCK0dMEO9iW4TvwZKw3A=; b=bRB5XjY4lQBHDkiv+auw3OjDrKlMXgjIUsRmMi5+wF0hFOR9oMG93qQ+xH6qoTOmic DB3TDR9377mw3OIbmdgbDBrhGI4zsjQKCEEgk2HJUKLrN4TE95e3RFYOa/MxIeRjnpEk UJ+kueecXWjcQO+09daV4EOqnXXLgluwHloDc1kpUTf9gvJuVtff66TJXcpB3Jfht8ZI tQ4d/FIJ3F16wMpMR6JHL62kH74FOESLmiTkZiuDAuQeOAhRCb/mJaQC5NkBuvxR0xbv ol/zx+8/Z6PqPLeyoZ5S5c7XcVZuzB4UFdppWu4Ejj6O+9FffTi4twnb14IJxKcvh5NL kyQg== 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=jJjPRo2jnYNBTT+kAOkS5uMVCK0dMEO9iW4TvwZKw3A=; b=qLXbBsFcoWCKVs3jIeY7trZoI8VaOhwZLo8Y7V4mtO6ZnODAuvwI8zf3kGjZMUAKUu olbyrBlJzzekDuht8h1s3q+BkxorWG9WBM7e417hyVSl6c7CPvKPyeyqZpa/dRWAcvmA m4yfRGIQdxZ/SHF0tumsineY17rQIDH2vdzKednGaTImU7HUWafUyedEwOe5GK4qu47j KsRkE9VWvqb7P8E+4dC2vtY4AYoypZFNXfdGNLpmqZyljD5gcgUkU2QA5BUFofiEpuki LE/aWoxR0oCTTlBFDmPI3hQNJCiTexEn8WV1GshgIYM3Mf/RiDLXjkSmBxJdbndpR8pR xpCg== X-Gm-Message-State: ACrzQf3phN9HfgaLgT7ubFq1b+aQddbqFnLsUVAM8Qw4LDSx8VvoNbsY q/EZaZN9DdlXemIO+eNnBepTwurfjPzOCp1/ X-Google-Smtp-Source: AMsMyM61Jcanu2bgctKANpQIAPP1f3v6IQZst1KjFW0FDt8uColB0JfZ1Vg0UIt7Qhs7L95fxO0yww== X-Received: by 2002:a17:902:8e88:b0:185:3cea:6335 with SMTP id bg8-20020a1709028e8800b001853cea6335mr19734673plb.96.1667311100429; Tue, 01 Nov 2022 06:58:20 -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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Akihiko Odaki Subject: [PATCH v8 04/17] ahci: Omit errp for pci_add_capability Date: Tue, 1 Nov 2022 22:57:36 +0900 Message-Id: <20221101135749.4477-5-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221101135749.4477-1-akihiko.odaki@daynix.com> References: <20221101135749.4477-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@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::102a; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x102a.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@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20210112.gappssmtp.com) X-ZM-MESSAGEID: 1667323534840100001 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/ide/ich.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/ide/ich.c b/hw/ide/ich.c index 1007a51fcb..3b478b01f8 100644 --- a/hw/ide/ich.c +++ b/hw/ide/ich.c @@ -106,7 +106,7 @@ static void pci_ich9_ahci_init(Object *obj) static void pci_ich9_ahci_realize(PCIDevice *dev, Error **errp) { struct AHCIPCIState *d; - int sata_cap_offset; + uint8_t sata_cap_offset; uint8_t *sata_cap; d =3D ICH9_AHCI(dev); int ret; @@ -130,11 +130,7 @@ static void pci_ich9_ahci_realize(PCIDevice *dev, Erro= r **errp) &d->ahci.mem); =20 sata_cap_offset =3D pci_add_capability(dev, PCI_CAP_ID_SATA, - ICH9_SATA_CAP_OFFSET, SATA_CAP_S= IZE, - errp); - if (sata_cap_offset < 0) { - return; - } + ICH9_SATA_CAP_OFFSET, SATA_CAP_S= IZE); =20 sata_cap =3D dev->config + sata_cap_offset; pci_set_word(sata_cap + SATA_CAP_REV, 0x10); --=20 2.38.1