From patchwork Thu Mar 2 22:40:56 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: 658169 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp145532wrb; Thu, 2 Mar 2023 14:44:22 -0800 (PST) X-Google-Smtp-Source: AK7set/b5LrFa7QtJpM0QjDdIp0NPdIo6hOLDCCxUjBd8/HiZ2YjCFreGl2GE4IiN8p7AjdD2hUu X-Received: by 2002:ac8:5893:0:b0:3bf:d8b6:4ca1 with SMTP id t19-20020ac85893000000b003bfd8b64ca1mr19260017qta.28.1677797062444; Thu, 02 Mar 2023 14:44:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677797062; cv=none; d=google.com; s=arc-20160816; b=UbiyeYERWCRbPPEk3GcdJTKTXUxkt9lQ514YrS3AbmLnICOmMrXwT4ydMz3McC69fN xkg2HHVy3B0O7GVHzvnQDVgyZbtaPXLTHtBw1Oo03Zqc7MKojgPc1HBc8CpNXjh1yt3P vd40Lul59HrHlBi/LssIDg0C5DrAK6B3D03g4G1uUAsU1BaAAR6ZftmvMJag4TN1Ixsq TEQFexzvEtLqMLneSHQPhUgHq4ynvDz9e2YXpUmiSZDJfkiU68idemqoCK4hJGMpKe6t mOtqw57264KrEvgPsFqmalcvtYFfzwWY9iJL1DCy5iq6fV8+OoZiCPBE0gvelzKQHTBu R2GQ== 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=df58h/AdXCUfIsw29990QJNsnEG6zfozV6HUit6iE6U=; b=YpHS4qOLIX1pGBPYcIyn3QoShvetq26fhUThXjVSJ0G6g3uXIxLsgBsopH95UW1Zfy O74VH+BGHV1/PbOcp4DT/ezn+J8VEdlekfxe8QPIYQEz0HgQkex6q1A56ZJ+QGoxz/Xr oLd+QNpsXaa8UX4MpWmXlSjc85aoSP0U5Jq1sVNvq+srq9H6RsVjjAdv34h7kozFzVpC 6qdXCdFEZKXxgfpkfATEEbdgFMBD+JM+MZO2+UmvLCKB9z1nmS3ZPpuruVwSDRBxf3Z/ 56VLFCyJonH+D24PthuWSR4mGbd+XPwifWVTB3pqEBf+KboHgQiEoaswMzHfI765VFiB iZIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h4Knyj0Z; 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 w12-20020ac857cc000000b0039d0b7ce2c0si593109qta.258.2023.03.02.14.44.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Mar 2023 14:44:22 -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=h4Knyj0Z; 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 1pXrdh-0001kv-Hc; Thu, 02 Mar 2023 17:43:05 -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 1pXrde-0001gE-Qg for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:43:02 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXrdd-0000EZ-6l for qemu-devel@nongnu.org; Thu, 02 Mar 2023 17:43:02 -0500 Received: by mail-wm1-x330.google.com with SMTP id j3so581404wms.2 for ; Thu, 02 Mar 2023 14:43:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677796980; 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=df58h/AdXCUfIsw29990QJNsnEG6zfozV6HUit6iE6U=; b=h4Knyj0Z8KTC4eV7VdLnn//y14JwUcX97mrkVBCnvrPzpEOHB1aKjYljpr1NJXF9hk kVK1E1sj4Tyhv0DoIdeVK6m4aNUCa7vmdzWdWadYCUpg29DMmynTW6y337ROV0Uf7v2s 2q1iVCVnNvePBisQfuthkddW8khK//3wPdseVSfVNLFB1FmcSEKA3LRxyXGw4Bh/6Yr5 GUu26AVdnNiUZRl8jUu9nV0PUUNlNOoJEzJYIXQJeiLlrFrI7jFdP3N9WnSFq1LmctW4 PIC6xxJmurjAIMbmIJt+m0+luNXX16UxtoATp569jG3eoK1eh2FcboEJWlIeZaAWPhty kwzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677796980; 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=df58h/AdXCUfIsw29990QJNsnEG6zfozV6HUit6iE6U=; b=OorIkeXApoO64NBvwlO0BpcecJqCkoEBL+y+gAeGYsPA75Dqe9KSbzWOo3/E4uliIW P+/IsMc5YdBhVOZLTogKvEzkzG8gKwr5iSsCUHIkbLeYifPhKCAc04BIgoKU23WcZ7JE olRr2a9hzNWBAeJTIXiw6e3QLcQ104sXuOVZYUvuZqMgwRuRS7lJRdQaW/rG2QoGEXgS WldnoPKsWFl1YDr7V5V+PMgIjBq9z3+8L4uL3+8FprVR8GyTkXxmbpSQOpXp1x7E7T/C YKHiEvMNez9FCYOQyBw2l5+LVjQWNtU1coLIQARYNA2c1pEB1SxeJbfhjWi0ztqZFfus DzhA== X-Gm-Message-State: AO0yUKUqaX/CRg/o265NLVpgyS4tGe4G1yAo3idR7YhNYR4UzIUXOu/O TmoCWgp0nfjwkrdNQhJ3oQm4kqdzrrgseQTZ X-Received: by 2002:a05:600c:1708:b0:3ea:c100:f18d with SMTP id c8-20020a05600c170800b003eac100f18dmr8587990wmn.9.1677796980304; Thu, 02 Mar 2023 14:43:00 -0800 (PST) Received: from localhost.localdomain (43.red-95-127-39.staticip.rima-tde.net. [95.127.39.43]) by smtp.gmail.com with ESMTPSA id p21-20020a05600c431500b003daf672a616sm719382wme.22.2023.03.02.14.42.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Mar 2023 14:42:59 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Bernhard Beschow Cc: John Snow , David Woodhouse , BALATON Zoltan , =?utf-8?q?Herv=C3=A9_Poussineau?= , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PATCH v3 16/18] hw/isa/piix: Batch register QOM types using DEFINE_TYPES() macro Date: Thu, 2 Mar 2023 23:40:56 +0100 Message-Id: <20230302224058.43315-17-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230302224058.43315-1-philmd@linaro.org> References: <20230302224058.43315-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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 See rationale in commit 38b5d79b2e ("qom: add helper macro DEFINE_TYPES()"). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland --- hw/isa/piix3.c | 53 +++++++++++++++++++++----------------------------- 1 file changed, 22 insertions(+), 31 deletions(-) diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index a9cb39bf21..0ee94a2313 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -346,19 +346,6 @@ static void pci_piix3_class_init(ObjectClass *klass, void *data) adevc->build_dev_aml = build_pci_isa_aml; } -static const TypeInfo piix3_pci_type_info = { - .name = TYPE_PIIX3_PCI_DEVICE, - .parent = TYPE_PCI_DEVICE, - .instance_size = sizeof(PIIX3State), - .abstract = true, - .class_init = pci_piix3_class_init, - .interfaces = (InterfaceInfo[]) { - { INTERFACE_CONVENTIONAL_PCI_DEVICE }, - { TYPE_ACPI_DEV_AML_IF }, - { }, - }, -}; - static void piix3_realize(PCIDevice *dev, Error **errp) { ERRP_GUARD(); @@ -382,12 +369,6 @@ static void piix3_class_init(ObjectClass *klass, void *data) k->realize = piix3_realize; } -static const TypeInfo piix3_info = { - .name = TYPE_PIIX3_DEVICE, - .parent = TYPE_PIIX3_PCI_DEVICE, - .class_init = piix3_class_init, -}; - static void piix3_xen_realize(PCIDevice *dev, Error **errp) { ERRP_GUARD(); @@ -416,17 +397,27 @@ static void piix3_xen_class_init(ObjectClass *klass, void *data) k->realize = piix3_xen_realize; } -static const TypeInfo piix3_xen_info = { - .name = TYPE_PIIX3_XEN_DEVICE, - .parent = TYPE_PIIX3_PCI_DEVICE, - .class_init = piix3_xen_class_init, +static const TypeInfo piix_isa_types[] = { + { + .name = TYPE_PIIX3_PCI_DEVICE, + .parent = TYPE_PCI_DEVICE, + .instance_size = sizeof(PIIX3State), + .class_init = pci_piix3_class_init, + .abstract = true, + .interfaces = (InterfaceInfo[]) { + { INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { TYPE_ACPI_DEV_AML_IF }, + { }, + }, + }, { + .name = TYPE_PIIX3_DEVICE, + .parent = TYPE_PIIX3_PCI_DEVICE, + .class_init = piix3_class_init, + }, { + .name = TYPE_PIIX3_XEN_DEVICE, + .parent = TYPE_PIIX3_PCI_DEVICE, + .class_init = piix3_xen_class_init, + } }; -static void piix3_register_types(void) -{ - type_register_static(&piix3_pci_type_info); - type_register_static(&piix3_info); - type_register_static(&piix3_xen_info); -} - -type_init(piix3_register_types) +DEFINE_TYPES(piix_isa_types)