From nobody Sat Apr 5 01:03:31 2025 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; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1739396131; cv=none; d=zohomail.com; s=zohoarc; b=eEHlKrxqC+TViTsH56hmHzpqcpRD/gbpUxHaQ4+j50elrNviJ0FoTCya/Wp9Rs+GSh7MDPPkkeRusAKa3/dl3q68Iw+f7A9bHAJy84f2IYzszZXps6p/WgAHZxAiGKFmrMeBwkkRNm4RjqKblk8md5aa22uKClrAx0J/Sv9fJFA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1739396131; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3tahwZukGhQY0cObaTIwWhUmXQqOFwvV4yeEEvNe3Ak=; b=mLY2IXOLVTRrjSFQWrJb0osPDnDEjJDSfzyr/MY6/zVqhoOsLxx06ZeN3gQiMSMcDel8r9QrgNeg7VjUnt4Bg3hBJFFmoG1fLSNmqHdBA7XWF2Cht3OeqoajSWKiJ4OnAQbYO8kIj1VlmP3a2NvgMfQTVX83bVlNDvQxjJnOm50= 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1739396131795929.1023532446306; Wed, 12 Feb 2025 13:35:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tiKNG-00058E-So; Wed, 12 Feb 2025 16:34:27 -0500 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 1tiKND-0004se-Pv for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:34:24 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tiKNC-0000Zi-9O for qemu-devel@nongnu.org; Wed, 12 Feb 2025 16:34:23 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4394a0c65fcso2195365e9.1 for ; Wed, 12 Feb 2025 13:34:21 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38f259d5e9esm20117f8f.61.2025.02.12.13.34.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 13:34:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739396060; x=1740000860; darn=nongnu.org; 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=3tahwZukGhQY0cObaTIwWhUmXQqOFwvV4yeEEvNe3Ak=; b=YfIj8rwM399z1uK855bV+qJDRi+1SpaVlSr16qLYDrewAdegp0GidellzbfSF6Qa2Z Dz7WFTeKYgDMaQQtCr5lJUMrs5JX8gwAy1xh04/uLtDhAIy401UszLjjgQDFiJU+xwdQ b7BImy/kqG0+Y6wHq+Yz1JqGAV7VD1cH9MX8pzr+uLySYUcnnZ9xgL1e1YacNj+eryKz ikjVoKbVMDNnhauwPj0GiLktdeQDcMl1d4VHzRDroEW76kb2ECtHt0XqVFrWTU/LC6Be x23F31qjMfe4+YTFpucA1cvwc7CZuk3BUw63HTn3rMxQZDuz9D3Xo0HR3qQ+uCAGmjya MCcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739396060; x=1740000860; 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=3tahwZukGhQY0cObaTIwWhUmXQqOFwvV4yeEEvNe3Ak=; b=ayb8s8yJHuSZnONb0YMwG2SWoeStsq1RNqBEy2SUn+BypO5usO3g3+e1Oh48o1O4SB cKNCQwdN3VX4uOc20JJq/g0EvyeVyyfEFEqyYc27mpLIk5O7w9pZ5TCJ/ttxFLowUU7Q rzFFCcttx3tlPdDQT3l3V05znBi6KxlibCF6GwyoXOtu9gb4AxUB3u196mNoHGqlf0/+ dM2lG21pLCecNrSvyeBfmnWxq6rwvrTUq2TBxa7uMnWyXNWm6RPdiQ9Fe8Pv6OTmCvBf GnXvXELakP5XFM0hn5sdAdHZkcRiJ/ZXc5UgVmkfwPgkL5epmLi1V9pYnYXPssC8fov8 ElGQ== X-Gm-Message-State: AOJu0YwLrKhzCxWuf40lVfZ8kpuxD4y5kCdXJU9umoXz6YG1X3T2WcA6 ePAJogTwpDVzulNc9GPbLOCjacg0bzBe2gRI/TPk0rqQDq7w8H4FQCECBAfNNhqNW7LuOtn2a13 NlMg= X-Gm-Gg: ASbGncuwKyjo7y5B3iBnIwUSSmXv7W30YaKctUsQBaAsBRKeP3996poUfhFlqIYFb2U Sj9bn+h5op9Ot7hHx6goQMIqXIlmHWiK4jBN8CNErPw/Qvt9U7BS90QYhtnvuBllagvKVvaxw3k 3iHKaL+lTWYinw7o2cQCurVbYvSs+d56aJd55dH4BriHzMVC63WqweFNVa2L3XRE5Q1V44Uq2cl l+aARCLmXBbuqhdrrTppWIEKasig92HA2xLGd4yh7txPUX4BPJV1vrq131d24xSZwiZlu628ELd JDk/XoJzh7uAZiI6xDswJ1CMv+1+GQVxfJGsr4EibDezZTAFPTbeB/qjhnRh1zem8Q== X-Google-Smtp-Source: AGHT+IGotS/3O+wmWktJ3ePo6qnkPb9/U65PSkIDob5JtKNMlNKiqGE7pwYsoUqmKRm9Zuyd9Z+05Q== X-Received: by 2002:a05:600c:1e0f:b0:434:f586:7520 with SMTP id 5b1f17b1804b1-43960185f0amr11972505e9.6.1739396060389; Wed, 12 Feb 2025 13:34:20 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 17/19] hw/virtio/virtio-pci: Reduce generic_type_info scope Date: Wed, 12 Feb 2025 22:32:47 +0100 Message-ID: <20250212213249.45574-18-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250212213249.45574-1-philmd@linaro.org> References: <20250212213249.45574-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1739396132775019100 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/virtio/virtio-pci.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 6f0e1772669..99724deb3d9 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -2488,18 +2488,6 @@ void virtio_pci_types_register(const VirtioPCIDevice= TypeInfo *t) .abstract =3D true, .interfaces =3D t->interfaces, }; - const TypeInfo generic_type_info =3D { - .name =3D t->generic_name, - .parent =3D t->base_name ?: base_name, - .class_init =3D t->base_name ? virtio_pci_generic_class_init - : virtio_pci_base_class_init, - .class_data =3D t->base_name ? NULL : t, - .interfaces =3D (const InterfaceInfo[]) { - { INTERFACE_PCIE_DEVICE }, - { INTERFACE_CONVENTIONAL_PCI_DEVICE }, - { } - }, - }; =20 assert(t->base_name || !t->non_transitional_name); assert(t->base_name || !t->transitional_name); @@ -2507,6 +2495,19 @@ void virtio_pci_types_register(const VirtioPCIDevice= TypeInfo *t) type_register_static(&base_type_info); =20 if (t->generic_name) { + const TypeInfo generic_type_info =3D { + .name =3D t->generic_name, + .parent =3D t->base_name ?: base_name, + .class_init =3D t->base_name ? virtio_pci_generic_class_init + : virtio_pci_base_class_init, + .class_data =3D t->base_name ? NULL : t, + .interfaces =3D (const InterfaceInfo[]) { + { INTERFACE_PCIE_DEVICE }, + { INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { } + }, + }; + type_register_static(&generic_type_info); } =20 --=20 2.47.1