From nobody Sat Nov 23 22:41:20 2024 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1730553762; cv=none; d=zohomail.com; s=zohoarc; b=i2bdAdJV2mUf4NLPn6BvsHNlLdiQyouKkjuzFjJnhhQLDBQb+VLYbcLXvA4wdlGpbfQT9SwX85WCrho5QAVKGQnWM3X6Y/GIcbDOrOfR614aHyEoL5N25tNacxf3VAH1RyLJuf+XRuQVbYBUyP7V5/BfLcF2CAS0ga1RLm0qNmQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1730553762; 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=8EgEQlxpALUpuI+hbJduRS0cA3mxUkzxDFRDbbfbr3U=; b=CNTMqFdFZoyLsQiGYnuzsYgfS6+MDS4RtfihWwkBv4PzgUDIy4PmcRc2du6GBeHEX9YkIbwl0/619vcDKBPzxN4G/fVOW41TRJ9ucQhfjvnbQ0W/Lyf76g0ZVsv3meSzPL8Et01qk4O3AEJDNTL/A3ZO1XUDWZN9OOVK3M75B+g= 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 1730553762097146.23089010900185; Sat, 2 Nov 2024 06:22:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E16-0003Kt-Jl; Sat, 02 Nov 2024 09:18:12 -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 1t7E10-0003FR-0q; Sat, 02 Nov 2024 09:18:06 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0y-00023F-5Q; Sat, 02 Nov 2024 09:18:05 -0400 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a9a2cdc6f0cso397990366b.2; Sat, 02 Nov 2024 06:18:03 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.18.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:18:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553482; x=1731158282; 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=8EgEQlxpALUpuI+hbJduRS0cA3mxUkzxDFRDbbfbr3U=; b=i4fzzXvdDphOF9pTttn6gQaVKk2Ac0g3BFeJn2SF6LKMExMrE/8ujG+iH8IHwTumIO djFVUC9zg/Sw4GnCwiS1eoyVX9QoWJ6IgTs67Zb4RU5uWGwWFl5EB/xB/sRxdEraERSh 8/xsrNRRhk4xZ1DoxMR5+6P63EcUUnHHczQgDhoGPbMyWfkAP1EMhd/qzXjd1C3GPoZm aPQdEdSOFK6qB0UEeNS2rmh+vR65+bV5PFB/tkOr/Dm6es5Tz2hb3S9i1lHvCQ7xRCKG vO/1lznzL4iZA0knret14KDHhxC/WP3uSTzXBkWX/+klF+1wIcQqViXXlxcJSSB8IkJ9 ZHXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553482; x=1731158282; 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=8EgEQlxpALUpuI+hbJduRS0cA3mxUkzxDFRDbbfbr3U=; b=lWuw+gP8W7bKc0tYv8eD23mac3c8H1j3CJXMRJUlJGR4iEeGbL3kPGXvUfori1F68c jK9jDvvIWqkiQsiPMDtY4aJK+JV4wHL/Lcgb0WqSCPIroSDM2szfsFuqlAO1dk6WCnFe 9CvjGNVDy1wkjrFcS4TFLgjSQzHoHB/2PVgcFloqd6iNjQaksouV2k4gx5ARCalmRx7h MWWatoMhhqxviFN1RV/m5CLVToWCVSsSF8XY9UtOymMkpvDmvi8p43raidCnmAYrTrMV d325f6zXuxq3S4XpUS5jdb2yfKalgM5aXIraMBrv11o/nLbN1XxQRKEfnlnrRIEsiB6y IyhQ== X-Forwarded-Encrypted: i=1; AJvYcCXJmO36dNkRjYajBnggPKv2WnZFL+mCEYYpB5rGUWn9lNbFv64VytDIAYgN8WXVpHpeccFZ9nxGuag=@nongnu.org, AJvYcCXnDAiRSgtwMGKFkIp63vE/fbvPIamMyiuWRWk3ixhG9UZ5EHnUzqgA3aOpJDiurKfZQOivdpoLRTBD@nongnu.org X-Gm-Message-State: AOJu0YxoXYWj6uythZwrh4qa2MHqFad0uGSqjUJe9Prt4EIJfFCIFR2u P+tvROXGnYXXoBoDIzq/aZjqMzVjLwxxMfXc7tmOfZnvuUgx4U6RHbifGg== X-Google-Smtp-Source: AGHT+IGjYismwkMa8WykNrz3odcA+GIEeIv28ItGF69z4MfB05nvmt9eDudRgDFV7r80fyLbyOkNXg== X-Received: by 2002:a17:907:72d6:b0:a9a:14fc:9868 with SMTP id a640c23a62f3a-a9e5089b6b2mr873736866b.4.1730553481475; Sat, 02 Nov 2024 06:18:01 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 24/26] hw/usb/hcd-ehci-sysbus: Prefer DEFINE_TYPES() macro Date: Sat, 2 Nov 2024 14:17:13 +0100 Message-ID: <20241102131715.548849-25-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> 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::636; envelope-from=shentey@gmail.com; helo=mail-ej1-x636.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, FREEMAIL_FROM=0.001, 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 @gmail.com) X-ZM-MESSAGEID: 1730553763431116600 Reviewed-by: C=C3=A9dric Le Goater Signed-off-by: Bernhard Beschow --- hw/usb/hcd-ehci-sysbus.c | 118 +++++++++++++++++---------------------- 1 file changed, 50 insertions(+), 68 deletions(-) diff --git a/hw/usb/hcd-ehci-sysbus.c b/hw/usb/hcd-ehci-sysbus.c index 2b1652f7a8..87a3bebe3e 100644 --- a/hw/usb/hcd-ehci-sysbus.c +++ b/hw/usb/hcd-ehci-sysbus.c @@ -19,7 +19,6 @@ #include "hw/qdev-properties.h" #include "hw/usb/hcd-ehci.h" #include "migration/vmstate.h" -#include "qemu/module.h" =20 static const VMStateDescription vmstate_ehci_sysbus =3D { .name =3D "ehci-sysbus", @@ -97,17 +96,6 @@ static void ehci_sysbus_class_init(ObjectClass *klass, v= oid *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } =20 -static const TypeInfo ehci_type_info =3D { - .name =3D TYPE_SYS_BUS_EHCI, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(EHCISysBusState), - .instance_init =3D ehci_sysbus_init, - .instance_finalize =3D ehci_sysbus_finalize, - .abstract =3D true, - .class_init =3D ehci_sysbus_class_init, - .class_size =3D sizeof(SysBusEHCIClass), -}; - static void ehci_platform_class_init(ObjectClass *oc, void *data) { SysBusEHCIClass *sec =3D SYS_BUS_EHCI_CLASS(oc); @@ -118,12 +106,6 @@ static void ehci_platform_class_init(ObjectClass *oc, = void *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } =20 -static const TypeInfo ehci_platform_type_info =3D { - .name =3D TYPE_PLATFORM_EHCI, - .parent =3D TYPE_SYS_BUS_EHCI, - .class_init =3D ehci_platform_class_init, -}; - static void ehci_exynos4210_class_init(ObjectClass *oc, void *data) { SysBusEHCIClass *sec =3D SYS_BUS_EHCI_CLASS(oc); @@ -134,12 +116,6 @@ static void ehci_exynos4210_class_init(ObjectClass *oc= , void *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } =20 -static const TypeInfo ehci_exynos4210_type_info =3D { - .name =3D TYPE_EXYNOS4210_EHCI, - .parent =3D TYPE_SYS_BUS_EHCI, - .class_init =3D ehci_exynos4210_class_init, -}; - static void ehci_aw_h3_class_init(ObjectClass *oc, void *data) { SysBusEHCIClass *sec =3D SYS_BUS_EHCI_CLASS(oc); @@ -150,12 +126,6 @@ static void ehci_aw_h3_class_init(ObjectClass *oc, voi= d *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } =20 -static const TypeInfo ehci_aw_h3_type_info =3D { - .name =3D TYPE_AW_H3_EHCI, - .parent =3D TYPE_SYS_BUS_EHCI, - .class_init =3D ehci_aw_h3_class_init, -}; - static void ehci_npcm7xx_class_init(ObjectClass *oc, void *data) { SysBusEHCIClass *sec =3D SYS_BUS_EHCI_CLASS(oc); @@ -168,12 +138,6 @@ static void ehci_npcm7xx_class_init(ObjectClass *oc, v= oid *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } =20 -static const TypeInfo ehci_npcm7xx_type_info =3D { - .name =3D TYPE_NPCM7XX_EHCI, - .parent =3D TYPE_SYS_BUS_EHCI, - .class_init =3D ehci_npcm7xx_class_init, -}; - static void ehci_tegra2_class_init(ObjectClass *oc, void *data) { SysBusEHCIClass *sec =3D SYS_BUS_EHCI_CLASS(oc); @@ -184,12 +148,6 @@ static void ehci_tegra2_class_init(ObjectClass *oc, vo= id *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } =20 -static const TypeInfo ehci_tegra2_type_info =3D { - .name =3D TYPE_TEGRA2_EHCI, - .parent =3D TYPE_SYS_BUS_EHCI, - .class_init =3D ehci_tegra2_class_init, -}; - static void ehci_ppc4xx_init(Object *o) { EHCISysBusState *s =3D SYS_BUS_EHCI(o); @@ -207,13 +165,6 @@ static void ehci_ppc4xx_class_init(ObjectClass *oc, vo= id *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } =20 -static const TypeInfo ehci_ppc4xx_type_info =3D { - .name =3D TYPE_PPC4xx_EHCI, - .parent =3D TYPE_SYS_BUS_EHCI, - .class_init =3D ehci_ppc4xx_class_init, - .instance_init =3D ehci_ppc4xx_init, -}; - /* * Faraday FUSBH200 USB 2.0 EHCI */ @@ -282,24 +233,55 @@ static void fusbh200_ehci_class_init(ObjectClass *oc,= void *data) set_bit(DEVICE_CATEGORY_USB, dc->categories); } =20 -static const TypeInfo ehci_fusbh200_type_info =3D { - .name =3D TYPE_FUSBH200_EHCI, - .parent =3D TYPE_SYS_BUS_EHCI, - .instance_size =3D sizeof(FUSBH200EHCIState), - .instance_init =3D fusbh200_ehci_init, - .class_init =3D fusbh200_ehci_class_init, +static const TypeInfo types[] =3D { + { + .name =3D TYPE_SYS_BUS_EHCI, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(EHCISysBusState), + .instance_init =3D ehci_sysbus_init, + .instance_finalize =3D ehci_sysbus_finalize, + .abstract =3D true, + .class_init =3D ehci_sysbus_class_init, + .class_size =3D sizeof(SysBusEHCIClass), + }, + { + .name =3D TYPE_PLATFORM_EHCI, + .parent =3D TYPE_SYS_BUS_EHCI, + .class_init =3D ehci_platform_class_init, + }, + { + .name =3D TYPE_EXYNOS4210_EHCI, + .parent =3D TYPE_SYS_BUS_EHCI, + .class_init =3D ehci_exynos4210_class_init, + }, + { + .name =3D TYPE_AW_H3_EHCI, + .parent =3D TYPE_SYS_BUS_EHCI, + .class_init =3D ehci_aw_h3_class_init, + }, + { + .name =3D TYPE_NPCM7XX_EHCI, + .parent =3D TYPE_SYS_BUS_EHCI, + .class_init =3D ehci_npcm7xx_class_init, + }, + { + .name =3D TYPE_TEGRA2_EHCI, + .parent =3D TYPE_SYS_BUS_EHCI, + .class_init =3D ehci_tegra2_class_init, + }, + { + .name =3D TYPE_PPC4xx_EHCI, + .parent =3D TYPE_SYS_BUS_EHCI, + .class_init =3D ehci_ppc4xx_class_init, + .instance_init =3D ehci_ppc4xx_init, + }, + { + .name =3D TYPE_FUSBH200_EHCI, + .parent =3D TYPE_SYS_BUS_EHCI, + .instance_size =3D sizeof(FUSBH200EHCIState), + .instance_init =3D fusbh200_ehci_init, + .class_init =3D fusbh200_ehci_class_init, + }, }; =20 -static void ehci_sysbus_register_types(void) -{ - type_register_static(&ehci_type_info); - type_register_static(&ehci_platform_type_info); - type_register_static(&ehci_exynos4210_type_info); - type_register_static(&ehci_aw_h3_type_info); - type_register_static(&ehci_npcm7xx_type_info); - type_register_static(&ehci_tegra2_type_info); - type_register_static(&ehci_ppc4xx_type_info); - type_register_static(&ehci_fusbh200_type_info); -} - -type_init(ehci_sysbus_register_types) +DEFINE_TYPES(types) --=20 2.47.0