From patchwork Wed Jun 14 01:19:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 692568 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp704251wru; Tue, 13 Jun 2023 18:31:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ORqviLFFZRgYQAVhDds9NNrYs7JUG7cnRyVIyi/kF1jPaWvBmskNuMjBa8PFxukenyvxf X-Received: by 2002:ad4:5ca9:0:b0:626:29d4:9a26 with SMTP id q9-20020ad45ca9000000b0062629d49a26mr17720160qvh.37.1686706300037; Tue, 13 Jun 2023 18:31:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686706299; cv=none; d=google.com; s=arc-20160816; b=mlybISt3h/UzYQYa9c3cvft3Y5S0B4RW/nm3+47L+LhWzQekugMVpJI1IVKUMvFOET Exd7acy/iw1p6uNKS3Qc6bxz0nNBYjhTnhGtel1UeVvG/qzEiYxWXkWuudXa+N2osaYM SWomy8HowdETfyvmyfR2jPTB47RwvywF0+3GTqJLrDecslQyG9JJqIN3BcrKUyBKSPlD gJg/7TZE+AEYtlySljRKgUQoW4/q7+kOL3r4OuIRrudwXIweKAj6n6JeW6NU7X1fSDXM MRvBAS9bi1CfIHclC/vjNctaee9v3AN2msqCfPf0LzHX8YPJX1OVgmW+BMojSGqF7y4Q 9Whw== 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=4v3yawg0uOjmzzDcZNfQbha9k+Ps1ceIjWHX0t+xz98=; b=U3uTTXIQAghE9lB5bMby11d6bkhyDBcbUuDypxDahdgLl6ZJF1nqPvyC2jdV+c1EpS wmPrp7SOnhYSFn0Fw8Y5ojr/pIP0BNomWLjp3Dmzw3BoJF1JDAcM/tQnINY9Lgc30KKH /bJq+ACVKalWHxZEFg1Te4gNyXdqVtFUfwZBLa2R8hXj4QF1B/fqoMLn+72oTuHf80kU UEYBLMWLWHsukMFkgeTw2tykad4FIvuygKNcbh20u31S8VuzB1yr5BHoTlcUxFRSWDQG r8Us6N7xJ+KTb3H39CHQiwSSoBKogA8mJIPazfl62/ogvmUTuTyx0bcBWnurrMLpXxHD 23+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=a3ImHG+J; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q19-20020a05622a04d300b003f5619a8922si8274052qtx.519.2023.06.13.18.31.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Jun 2023 18:31:39 -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=@gmail.com header.s=20221208 header.b=a3ImHG+J; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q9FDO-0000AS-Aw; Tue, 13 Jun 2023 21:22:26 -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 1q9FDM-0008Lt-Gw for qemu-devel@nongnu.org; Tue, 13 Jun 2023 21:22:24 -0400 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q9FDK-0004kX-Mm for qemu-devel@nongnu.org; Tue, 13 Jun 2023 21:22:24 -0400 Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-75d4dd6f012so152624785a.2 for ; Tue, 13 Jun 2023 18:22:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686705741; x=1689297741; 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=4v3yawg0uOjmzzDcZNfQbha9k+Ps1ceIjWHX0t+xz98=; b=a3ImHG+JWK2MUgp7u5wSkq8l2rPaEG8K9GzBFo5ZC5NXe8qgK5fkLBiyTvI2B+0R1m 3TB89aVn9mfFqJH1G/7fop7S1+KT5oNFoDVmmsBz6MBpRdnKAFbilKepsF6FmAXxOBOU aM/wRnKKzTOIXmJ+MvXU2CpnNNICfYCzjJp96/4NlVObrE8mMVQDJOWwwTkO4EP9zFMg vRa+CChLKO98ckhJPDg4aHU6/a4iurnH0U3FsIriyWZGaEKZlDTnJjaFutxCfjvcx8fF nx1vo2E0ZmjPS1gNVC5Zg3JCELQnh7sWTp+QmRr9D3BJJXrVIHzq4X4GzlZV/tCZ8ixd 9Drg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686705741; x=1689297741; 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=4v3yawg0uOjmzzDcZNfQbha9k+Ps1ceIjWHX0t+xz98=; b=dKj9B7TeAWGNw9pL9a1MjICaPaMjtLk65KKcR3yFYbmz9p7kYjIC6Ow42ooDcGt+3L WnTfl3Iygxeor9zmZFCWTH681QxoRz7gz5ZdwVYniG0J8/J0pFdcg5lBTV3oZu5rytxa /xMpylG6O3McyuHy+MzZ7sktLl81VP++cbDaHWQbgPnOON0v138EegeulN8bAWnhCL3D jQr9s0Rw+UxDOiGgAls9pe6V+BYcmwDT4wSa/n0J/SVhbkvkIbKESGFvRngHmALp2N8z bcSS1VjHYrdtsLJLoCTzZTIyET0iuBGOUKidAEd3gaGT80bh2arGBp8E1o+T5QKdkBg5 VP3g== X-Gm-Message-State: AC+VfDzS6MnAKv3g8PgSlvBwnSLnNT32S/tebUwbqQaQrsmr1SvNj5j+ f8eQc60aqMsuttj2Iyf/mwtoacDmXA24Pw== X-Received: by 2002:a05:620a:278d:b0:75e:c496:dea1 with SMTP id g13-20020a05620a278d00b0075ec496dea1mr15313312qkp.78.1686705741554; Tue, 13 Jun 2023 18:22:21 -0700 (PDT) Received: from toolbox.wdc.com (2403-580b-97e8-0-321-6fb2-58f1-a1b1.ip6.aussiebb.net. [2403:580b:97e8:0:321:6fb2:58f1:a1b1]) by smtp.gmail.com with ESMTPSA id u1-20020aa78381000000b0064f7c56d8b7sm9112238pfm.219.2023.06.13.18.22.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 18:22:21 -0700 (PDT) From: Alistair Francis X-Google-Original-From: Alistair Francis To: qemu-devel@nongnu.org Cc: alistair23@gmail.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alistair Francis , Daniel Henrique Barboza Subject: [PULL 27/60] hw/riscv/opentitan: Declare QOM types using DEFINE_TYPES() macro Date: Wed, 14 Jun 2023 11:19:44 +1000 Message-Id: <20230614012017.3100663-28-alistair.francis@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230614012017.3100663-1-alistair.francis@wdc.com> References: <20230614012017.3100663-1-alistair.francis@wdc.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::72a; envelope-from=alistair23@gmail.com; helo=mail-qk1-x72a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: Philippe Mathieu-Daudé When multiple QOM types are registered in the same file, it is simpler to use the the DEFINE_TYPES() macro. Replace the type_init() / type_register_static() combination. This is in preparation of adding the OpenTitan machine type to this array in a pair of commits. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Reviewed-by: Daniel Henrique Barboza Message-Id: <20230520054510.68822-3-philmd@linaro.org> Signed-off-by: Alistair Francis --- hw/riscv/opentitan.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/hw/riscv/opentitan.c b/hw/riscv/opentitan.c index 2d21ee39c5..294955eeea 100644 --- a/hw/riscv/opentitan.c +++ b/hw/riscv/opentitan.c @@ -320,17 +320,14 @@ static void lowrisc_ibex_soc_class_init(ObjectClass *oc, void *data) dc->user_creatable = false; } -static const TypeInfo lowrisc_ibex_soc_type_info = { - .name = TYPE_RISCV_IBEX_SOC, - .parent = TYPE_DEVICE, - .instance_size = sizeof(LowRISCIbexSoCState), - .instance_init = lowrisc_ibex_soc_init, - .class_init = lowrisc_ibex_soc_class_init, +static const TypeInfo open_titan_types[] = { + { + .name = TYPE_RISCV_IBEX_SOC, + .parent = TYPE_DEVICE, + .instance_size = sizeof(LowRISCIbexSoCState), + .instance_init = lowrisc_ibex_soc_init, + .class_init = lowrisc_ibex_soc_class_init, + } }; -static void lowrisc_ibex_soc_register_types(void) -{ - type_register_static(&lowrisc_ibex_soc_type_info); -} - -type_init(lowrisc_ibex_soc_register_types) +DEFINE_TYPES(open_titan_types)