From patchwork Mon Oct 30 14:39:53 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: 739260 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c47:0:b0:32d:baff:b0ca with SMTP id n7csp1155928wrt; Mon, 30 Oct 2023 07:41:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFU++soxxiw5X6Ep5WpOxkcVkWMVsLcQMp7VNvGxuCwFkFlKI4ocMUe6jhWKQNmsgKPsvzS X-Received: by 2002:a05:620a:1c:b0:779:efb4:73bb with SMTP id j28-20020a05620a001c00b00779efb473bbmr9287417qki.41.1698676861951; Mon, 30 Oct 2023 07:41:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698676861; cv=none; d=google.com; s=arc-20160816; b=0B2FIq4brJd2TdaVwRkZJlhm0PNBg8Q8r/c39A+2qQHG1jDjsCb6ONN3Ctv/Fo5Uaz DZKAWlDq5zxSvnDEKAP4mFJw3riIrC5mhEbcWA/rWRl6PliPYNFkgP3jJtV6wagBiVfj CvZ8j+YiaJHdjfJkQ+LNRsKJBvJ2C22JoWYS3DGwFA7papSeNPFZb2m1v1oYioLcJhFS 1BJS9gAknN82UGebYPY/wRspndeOLtl57v2uy/RpKIQmVDbQlCOSLhLY4XC9CZA/n/0V JyostPa/0weK1ALMF7qXTW58hKkdTNAPQaeuG+PlX0Vmb4x5vlzNbF7ciU12Bzgq0N64 Igyw== 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=I7ToXfUjeHh4GxTtDabuQxd+6LNHtLDODSscY/4+OEc=; fh=h9i03/I3DsCPcmeGrMxb+5kHX6/oPGtJs5JE9RaGQZs=; b=hZn80Ek2Z18dcrnh9zs0JsdeOHOMSzoJTq2ZN7LrwDl5FLiX89qOMbCMG/JdE9xZco 0KW5YOJzhhocqYxZg3sWdOo/e2tVkeMnRJnPin09CSOeZr1BZ6UuZCDOn2CWq/PcjM3D /iowRbVmUE4LhdAFDKWPoHakMpvZXcZbG3ptx03hVBi9WJ4qgZ25qBCMjCLUbvs5lTXL Uak3uh8Z3/OMpnY3urNG4Q6gaMwcnTfnk/bUqjQ3FWhC33g8gW+AIb70l8pwkVGOMOHs EUzmI7y/MAGtBXxcfF9P4vp9LOxzLBBzrx+GDDHBfm8lP7qTuaT0hr+EZZL2VtVd0QFi zSRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m94c3oL4; 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 w21-20020a05620a095500b0076d873a45b7si5591329qkw.706.2023.10.30.07.41.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Oct 2023 07:41:01 -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=m94c3oL4; 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 1qxTRL-0001PY-9L; Mon, 30 Oct 2023 10:40:27 -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 1qxTRK-0001PH-3I for qemu-devel@nongnu.org; Mon, 30 Oct 2023 10:40:26 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qxTRC-0001nc-3g for qemu-devel@nongnu.org; Mon, 30 Oct 2023 10:40:25 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4083cd3917eso35863205e9.3 for ; Mon, 30 Oct 2023 07:40:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698676815; x=1699281615; 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=I7ToXfUjeHh4GxTtDabuQxd+6LNHtLDODSscY/4+OEc=; b=m94c3oL4/LntiFxMjuRMRaKE0tv/HEIqFav9i8c8rEzauMy5d8tsoC3Gl8MdBTBy6J 1Fcyv+/5UuL3E1g027oIuUW4vK4i7i4J68bYk3JHuhSzhLQX0BA7OrkYybGbEis07rB6 cVckVawLIa+TOMLhI9EiuNF/5s1TwqmBkUnbTuBjlH/uCvuEl8HBStcT6HKYqH0LqAt6 W76TvXzUip4PvsSFoQkhqz4I+e8n2UihDP8/Jr7TNeG8ij19aT+I4xp9bFS76i/MAxBu 7NH5fFQmpTKI/EgTJKvo3UxtcLPMdfz+TKMyGxL6YixUThNceNbhWa79Kh8FpWg4vfm3 Z8AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698676815; x=1699281615; 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=I7ToXfUjeHh4GxTtDabuQxd+6LNHtLDODSscY/4+OEc=; b=AMZT6VR/a0X/UejeANTHWKHptS4V+ZJKo0Rxwhb1sqMLDkH7lDjsUwyKHAKdBLVt+J fV6taoYyPQLCn/PfFp/Ulx6nIPf5DgwzAIm8rkDBJw3MWTIEGHU9EZ81twrm1tom8VSD ar6zP8AG86Q1OYRmQbq2K9WFbOzcLTTOrWLEN3UyAqYYcFCKq1WmugiHiAvJI8N3DgyL 7dIahskcpYCD4E6Lz5pRGTKwwyJQ6SJ04ngwes4RYv7aMhm81hpJ9g88D/deLUaOM7K/ KRJgVElMU3McEN/cskgaAGCyKw+gaWLrl6HnItydfvLzFdTvrWWDkksky9zscffkLXjh bwxw== X-Gm-Message-State: AOJu0YydtPoHzC5/gDUs0u7L7OFXJHNuTg0bAnPDfuu26ltw5PiZ86OE oZdRfHu+APX0YtSKWxqeskB8ZN2lH2yjo3p9/To= X-Received: by 2002:a05:600c:3ba5:b0:408:cd96:7179 with SMTP id n37-20020a05600c3ba500b00408cd967179mr8734464wms.9.1698676815397; Mon, 30 Oct 2023 07:40:15 -0700 (PDT) Received: from m1x-phil.lan ([176.170.212.50]) by smtp.gmail.com with ESMTPSA id n41-20020a05600c3ba900b004060f0a0fdbsm13029498wms.41.2023.10.30.07.40.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 30 Oct 2023 07:40:15 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Peter Maydell , Markus Armbruster Cc: Luc Michel , Daniel Henrique Barboza , Alistair Francis , Paolo Bonzini , Eduardo Habkost , Mark Cave-Ayland , Bernhard Beschow , qemu-ppc@nongnu.org, "Edgar E . Iglesias" , "Daniel P . Berrange" , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/5] hw/ppc/e500: Declare CPU QOM types using DEFINE_TYPES() macro Date: Mon, 30 Oct 2023 15:39:53 +0100 Message-ID: <20231030143957.82988-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231030143957.82988-1-philmd@linaro.org> References: <20231030143957.82988-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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: Daniel Henrique Barboza --- I'm going to do that for each file I modify, so eventually we'll get all converted. --- hw/ppc/ppce500_spin.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/hw/ppc/ppce500_spin.c b/hw/ppc/ppce500_spin.c index bbce63e8a4..e3608d8c16 100644 --- a/hw/ppc/ppce500_spin.c +++ b/hw/ppc/ppce500_spin.c @@ -195,17 +195,14 @@ static void ppce500_spin_class_init(ObjectClass *klass, void *data) dc->reset = spin_reset; } -static const TypeInfo ppce500_spin_info = { - .name = TYPE_E500_SPIN, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(SpinState), - .instance_init = ppce500_spin_initfn, - .class_init = ppce500_spin_class_init, +static const TypeInfo ppce500_spin_types[] = { + { + .name = TYPE_E500_SPIN, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(SpinState), + .instance_init = ppce500_spin_initfn, + .class_init = ppce500_spin_class_init, + }, }; -static void ppce500_spin_register_types(void) -{ - type_register_static(&ppce500_spin_info); -} - -type_init(ppce500_spin_register_types) +DEFINE_TYPES(ppce500_spin_types)