From patchwork Tue Nov 5 22:47:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 840835 Delivered-To: patch@linaro.org Received: by 2002:a5d:6307:0:b0:381:e71e:8f7b with SMTP id i7csp240565wru; Tue, 5 Nov 2024 14:52:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVFzLsFCvgHMSpoZD/FeAjSe8FGGBP4UpcoR1w76zQl6jexcGO2Bj6QrpojJlcFylCPhQdTrw==@linaro.org X-Google-Smtp-Source: AGHT+IFtLRXDvZKrNUTCRFwsKmlao8QR0e2kWBpXDWhTmpgUg7l4tN87iz0SQ9zJRzZL62PQkiAe X-Received: by 2002:a05:620a:4692:b0:7b1:541d:ed6 with SMTP id af79cd13be357-7b2f253d7bcmr2908506685a.40.1730847121548; Tue, 05 Nov 2024 14:52:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730847121; cv=none; d=google.com; s=arc-20240605; b=akA4JANltLnatLzBeBffOcXJGNnZCPhXXVL7Tc+Xu0/DBcNEUejkpfT8WXO0MYhIup ib21arPnv1nuEfsVvSD3OFLcBNy4PO0z7Q6RuEHXCD9fCTSxM0equgW7blAoBSRSt9Ui QXNXTT6AS9ea0hjAFSERI1daJsL5WocItJSZ5fwfpTzB9Wem0J99iv0CzL8bQY/YbvKg NQ39RYRxi1+pMfFQc4NUhJtL+/Mmz9rmAVM8E8WxAdvgoc2tHoBrPo13re1SnF3zjFwp h1kTtkNhW0btAyZOcu8L16vWZKZD4p3r23wno0lqeQkd6SZn4RsTmLzwDXXoUlUfBnuy q4AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DyXqCeyMzyWMkXhGNoMD/O7V9r2xwBHmziMl2tzMzbw=; fh=AUbIe/x05OB54MpDx0J1ZtOu3YJ9qKm4HFGYPvj71BQ=; b=TTB0OhPNdEg79VuRGx5hgRNqoPVpWPNSSjbev0ycBNr6tlv0JSovGNXxy75cHhmhH6 DgEt1pycegvDNYQiy2Gv2VQQQ0MtZ+emKBgndDTZlVyP1kabo4bS2fGHOtvv5vQ+dK2N ltKV0oHEUjqZdY+jwZ7B8rd4qjL9dMLSQpek13GBRyds5q4hQAOjxLlkcLgBTGBhzmzO mUQsBqcPo9J1oJvYffHuQevXB6nDeqXg2E9Ax69zhSQMbhc7Y4Bpb94hgOhPXro5xmWe 9Jvd4GQ1v/zTXbsI+YeuCFlhK4aebTlvlHAJsG0GR/0TUP93aHCGdIjdzTEkaQUKxraF QL3g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MfQFXp0k; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b2f39f242dsi1461336885a.39.2024.11.05.14.52.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 14:52:01 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MfQFXp0k; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8SMb-0007kM-28; Tue, 05 Nov 2024 17:49:29 -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 1t8SMN-00074m-DN for qemu-devel@nongnu.org; Tue, 05 Nov 2024 17:49:17 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8SML-0004MS-Oj for qemu-devel@nongnu.org; Tue, 05 Nov 2024 17:49:15 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4314b316495so51661595e9.2 for ; Tue, 05 Nov 2024 14:49:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730846952; x=1731451752; 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=DyXqCeyMzyWMkXhGNoMD/O7V9r2xwBHmziMl2tzMzbw=; b=MfQFXp0keDznGXT23gWaA4U0Yr+ufvbGT7/tZPAsB/jHUIEJ4cQ9mL1RHYjLf9EDF2 iyXCHEXA9JexbmjczBs3PemKl4S1JJw9n5Lrmv5Kj4Z9R5iLaGpsuBbksT4LNdO5cZ0Q 8B3mUFhjP/tYnYKJHdr2cF4UcyG0NEDzzDd276JW7ZebdKkoCzehv9BJOO0pxlOzeqdk rwx/cEIQge2JCd2fK7xphV6vO0yuejeOS7+/GBteF/ZQ2zOBoApd91eabPkeErzvGMv5 W5b5HoomCdkNyIo1VQ0T1LmN1eaV0GPmDg03+jAbjBMHcBprgYBBa6Ccqz/v4wbqzRVj 2rgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730846952; x=1731451752; 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=DyXqCeyMzyWMkXhGNoMD/O7V9r2xwBHmziMl2tzMzbw=; b=sa2JgrmHdcG3WbtOSBfql1iSxDhCq7rjJ3OPlkDIOpz40VdXtc0DvbRoT39jKU+rB7 5uOc37IJndzmB7HNIDh4l03n11h+4PzSOtnOTn6tXHArlCFDDneLI+gRg84P+1A081tD HjO9KBbvJEEfERR2NuDEEwK9p+UUA7dsfciITsr/+KUlQ7YAVOvw13s/IDIE/HpCat1Y bz6VlQex9xwbYDCQKNiIacPhX+bJskFKriydZdeUs3mbTyuZFj7QgUPC7fTigFQURfi4 M3vkRezZOAF7mq5mNRW5ayViYYpKgOIa46oOBguzUCnSwg+PBdTEWf9t2ML4dVwrc2o4 TX1g== X-Gm-Message-State: AOJu0YyZX4TELJ5RR1NktOJ3CJK0d1OY2Xz1WS9R/joujXWVm1ThoiT/ YWtBEg+W7BxBMcCvZyxey9yTra3RmdeCMtVnyTG9Rcl3B6koLrXpst57Bz9kj+4Kz6Wg+zmUvd6 oQKnC/g== X-Received: by 2002:a05:600c:a08:b0:431:4a83:2d80 with SMTP id 5b1f17b1804b1-4327b6c1c78mr199565295e9.0.1730846951699; Tue, 05 Nov 2024 14:49:11 -0800 (PST) Received: from localhost.localdomain ([154.14.63.34]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432aa70a1d8sm984705e9.27.2024.11.05.14.49.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Nov 2024 14:49:10 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bernhard Beschow , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Philippe_Math?= =?utf-8?q?ieu-Daud=C3=A9?= Subject: [PULL 19/29] hw/pci-host/ppce500: Prefer DEFINE_TYPES() macro Date: Tue, 5 Nov 2024 22:47:17 +0000 Message-ID: <20241105224727.53059-20-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241105224727.53059-1-philmd@linaro.org> References: <20241105224727.53059-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bernhard Beschow Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow Message-ID: <20241103133412.73536-15-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/pci-host/ppce500.c | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index 5a4a924a2f0..b70631045a0 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -22,7 +22,6 @@ #include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" #include "qemu/bswap.h" -#include "qemu/module.h" #include "hw/pci-host/ppce500.h" #include "qom/object.h" @@ -508,17 +507,6 @@ static void e500_host_bridge_class_init(ObjectClass *klass, void *data) dc->user_creatable = false; } -static const TypeInfo e500_host_bridge_info = { - .name = TYPE_PPC_E500_PCI_BRIDGE, - .parent = TYPE_PCI_DEVICE, - .instance_size = sizeof(PPCE500PCIBridgeState), - .class_init = e500_host_bridge_class_init, - .interfaces = (InterfaceInfo[]) { - { INTERFACE_CONVENTIONAL_PCI_DEVICE }, - { }, - }, -}; - static Property pcihost_properties[] = { DEFINE_PROP_UINT32("first_slot", PPCE500PCIState, first_slot, 0x11), DEFINE_PROP_UINT32("first_pin_irq", PPCE500PCIState, first_pin_irq, 0x1), @@ -535,17 +523,23 @@ static void e500_pcihost_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_ppce500_pci; } -static const TypeInfo e500_pcihost_info = { - .name = TYPE_PPC_E500_PCI_HOST_BRIDGE, - .parent = TYPE_PCI_HOST_BRIDGE, - .instance_size = sizeof(PPCE500PCIState), - .class_init = e500_pcihost_class_init, +static const TypeInfo e500_pci_types[] = { + { + .name = TYPE_PPC_E500_PCI_BRIDGE, + .parent = TYPE_PCI_DEVICE, + .instance_size = sizeof(PPCE500PCIBridgeState), + .class_init = e500_host_bridge_class_init, + .interfaces = (InterfaceInfo[]) { + { INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { }, + }, + }, + { + .name = TYPE_PPC_E500_PCI_HOST_BRIDGE, + .parent = TYPE_PCI_HOST_BRIDGE, + .instance_size = sizeof(PPCE500PCIState), + .class_init = e500_pcihost_class_init, + }, }; -static void e500_pci_register_types(void) -{ - type_register_static(&e500_pcihost_info); - type_register_static(&e500_host_bridge_info); -} - -type_init(e500_pci_register_types) +DEFINE_TYPES(e500_pci_types)