From patchwork Thu Oct 19 21:17:40 2023 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: 735619 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1731314wro; Thu, 19 Oct 2023 14:24:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZRFpEgV8I2z9hfJwfI9eexGThQtInfJ+1wXuzPgcfT0Wn2ot+4DqTtt8sytCYum08vq7w X-Received: by 2002:a25:404d:0:b0:d9a:3bee:2eeb with SMTP id n74-20020a25404d000000b00d9a3bee2eebmr3754555yba.60.1697750651000; Thu, 19 Oct 2023 14:24:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697750650; cv=none; d=google.com; s=arc-20160816; b=k7gDO+uYwr1auEgzgdd9i9EPQdlb+PxMC/mQXSpf+ff92anzJEt91aUbEY6CPkpwD1 bopMfrlpGMCOXtPP+U0pWxGEjnJ7+s9ACWjLQ5Lux/9TTpvYzcog5VQzl2Rm+iBOEscS FoKdLqJ6Z1uk8aScLt/1RudT71o053WNiRHZEdV82mbWEz0g8C/lHF04jjcdEHWYLwWU n6yvOB8Hs7CDw0I1fGG7Rq2UxwLSsfLy8WGdGJ4fsYPZJe2ihEUmA7mtqOWJujIGdPcI fQziuvQ5kK2AZfLXPJ+hGi6bNCWQrDFrD/h6JtiOkyAQYBOto/xiCtQjA4zSJTRWettO K1Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=5L3KhgnR+wD3KYNvWp6CWYVG73hhXTbT/VSAj1bhVwM=; fh=JJVrIxA960fi2M8f1oD8ZiXLObaAuT+S4YeQ3hi6v/I=; b=reMWJQCNzOxmuiSxVLIPixUEN9yosaA1VSPheidOFWZU5jb/3sGDivf3qaOHbEAvAI f5RWwo2yCikUnkD82xSWcNV7TUpEfn5SLGOlaDKYcoBM9q/RSLHjw6T+3/pTjod4X9gw 9QNIKB7jT8j1FeE47JS6WdBcAwjzMx2gDhNevOjyFzn7Rz9zfYQlbaEmSaHfmLYJZhe0 6KOWGe3D2pF0ztCgHh5BhPSYsmjcxqHkxRvX/RJeclZsRju05hxgYrUAxQIjnEpvr8Ig U3AzBFvtzfrpxqvlcQ1YQJWfWgHygfRTM61Kd3ZfUC2ledc2tExJjKImwTZrBljXka7X 62BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N5WPcaSW; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ei5-20020ad45a05000000b0066d16ed048asi354262qvb.29.2023.10.19.14.24.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Oct 2023 14:24:10 -0700 (PDT) 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=N5WPcaSW; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtaRE-0007YS-59; Thu, 19 Oct 2023 17:20:16 -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 1qtaQz-0007HJ-FE for qemu-devel@nongnu.org; Thu, 19 Oct 2023 17:20:01 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtaQx-0005B2-Eq for qemu-devel@nongnu.org; Thu, 19 Oct 2023 17:20:01 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-32db8f8441eso121773f8f.0 for ; Thu, 19 Oct 2023 14:19:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697750396; x=1698355196; 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=5L3KhgnR+wD3KYNvWp6CWYVG73hhXTbT/VSAj1bhVwM=; b=N5WPcaSWVaFJ9iyQSiuRHSaSFqeTfDy3aN+rLAwIRSFb8lkDR3U3gDDevC0h1uNg1S fvfeBgU6RUR1vhzG1etx6B0OqmJNt0ltCLqWLLKQhI4NRrvJ1anu+jYiVyU/3BEgnNs/ qBip4i50VkqMfMXvW6I9cOds0er7OKesxl0Fa4nwwaaueswnR8zwx40+h8xL4Q0DK5yl BQk18LNSUu/dZJsfLGhzfToFAqoeGJm+BmkjTDBf7auKbBoBvqr5DszSVAjuyCJf4jfd m/U/5Y/N3Z3QejCz1WfH2r1RD9ZxYV55InHEA7D/S7SXmqTe5KZsZIzQbymg9guHfKow DGlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697750396; x=1698355196; 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=5L3KhgnR+wD3KYNvWp6CWYVG73hhXTbT/VSAj1bhVwM=; b=T7i+ggGO7aR50uteZN57io2Kn6i4Z1H0JRWDnPC6bGeSYPcL3uO3mJImYaVKoz5Stv WYEF5tAq63r95sY1TzjhZWfBA4hDinqtbyQ4Adli3ROx0Y+WfHuYKep53VThUqKY73lT HgLFh+0kDYDAogXl+BgShNXkjd985BDpuiPvvKHh8GFX+zcm8J8ZRa77sOXE1dIgwMiJ pwAieSMfZG1SqV/YNeYYZn09kep0bV9ENzdUTv/zmUcvqEKyemmU9jGG5OFH5Iw08CT1 LoROkaesme6v+5et73YeB7ShW0ZXXCqOpfIcm+orquUayL5mEP+7FedWWYbswI67opnr WIFg== X-Gm-Message-State: AOJu0YzDpqJ3MLu7+jrFt+X4LI5T0gFSHyDtKJ/eMaF88lZdW8J4K0Mg SBIP63N+9uQ4nk3B0Gtq69gen0kjWEeuvSqsCkWT5g== X-Received: by 2002:a5d:4202:0:b0:32d:9b80:e2c6 with SMTP id n2-20020a5d4202000000b0032d9b80e2c6mr1914430wrq.26.1697750396472; Thu, 19 Oct 2023 14:19:56 -0700 (PDT) Received: from m1x-phil.lan (176-131-216-177.abo.bbox.fr. [176.131.216.177]) by smtp.gmail.com with ESMTPSA id h2-20020a5d5042000000b0032d886039easm233498wrt.14.2023.10.19.14.19.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Oct 2023 14:19:56 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Yoshinori Sato , Magnus Damm Subject: [PULL 15/46] hw/pci-host/sh_pcic: Declare CPU QOM types using DEFINE_TYPES() macro Date: Thu, 19 Oct 2023 23:17:40 +0200 Message-ID: <20231019211814.30576-16-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231019211814.30576-1-philmd@linaro.org> References: <20231019211814.30576-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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=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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org When multiple QOM types are registered in the same file, it is simpler to use the the DEFINE_TYPES() macro. In particular because type array declared with such macro are easier to review. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Yoshinori Sato Message-Id: <20231012041237.22281-2-philmd@linaro.org> --- hw/pci-host/sh_pci.c | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/hw/pci-host/sh_pci.c b/hw/pci-host/sh_pci.c index 77e7bbc65f..41aed48c85 100644 --- a/hw/pci-host/sh_pci.c +++ b/hw/pci-host/sh_pci.c @@ -167,17 +167,6 @@ static void sh_pci_host_class_init(ObjectClass *klass, void *data) dc->user_creatable = false; } -static const TypeInfo sh_pci_host_info = { - .name = "sh_pci_host", - .parent = TYPE_PCI_DEVICE, - .instance_size = sizeof(PCIDevice), - .class_init = sh_pci_host_class_init, - .interfaces = (InterfaceInfo[]) { - { INTERFACE_CONVENTIONAL_PCI_DEVICE }, - { }, - }, -}; - static void sh_pci_device_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); @@ -185,17 +174,22 @@ static void sh_pci_device_class_init(ObjectClass *klass, void *data) dc->realize = sh_pci_device_realize; } -static const TypeInfo sh_pci_device_info = { - .name = TYPE_SH_PCI_HOST_BRIDGE, - .parent = TYPE_PCI_HOST_BRIDGE, - .instance_size = sizeof(SHPCIState), - .class_init = sh_pci_device_class_init, +static const TypeInfo sh_pcic_types[] = { + { + .name = TYPE_SH_PCI_HOST_BRIDGE, + .parent = TYPE_PCI_HOST_BRIDGE, + .instance_size = sizeof(SHPCIState), + .class_init = sh_pci_device_class_init, + }, { + .name = "sh_pci_host", + .parent = TYPE_PCI_DEVICE, + .instance_size = sizeof(PCIDevice), + .class_init = sh_pci_host_class_init, + .interfaces = (InterfaceInfo[]) { + { INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { }, + }, + }, }; -static void sh_pci_register_types(void) -{ - type_register_static(&sh_pci_device_info); - type_register_static(&sh_pci_host_info); -} - -type_init(sh_pci_register_types) +DEFINE_TYPES(sh_pcic_types)