From patchwork Tue Jul 23 20:38:32 2024 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: 813972 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp2489035wro; Tue, 23 Jul 2024 13:40:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXgP5AOziQd4AwKZ6OqrDkoaWGRJFHLA1vmcgWqaGSD8HApLIroeuuunK6Y+FzF44pqsm/7uRzhmNgUJaDLPbkK X-Google-Smtp-Source: AGHT+IGIIHsBhMKKAOSYeYN7HBAy8Ek2VslMhlb6s1sM3xaTALGZXpLkaEaFTqwZIQui7ksEGTEQ X-Received: by 2002:a05:6102:1484:b0:493:b4cc:93ac with SMTP id ada2fe7eead31-493b4cc9478mr4778260137.21.1721767234781; Tue, 23 Jul 2024 13:40:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721767234; cv=none; d=google.com; s=arc-20160816; b=fDbrqa3kRdX/fobhV419fbNBBuAbayax0TCLMm0xvUmUJVmN3krkHLV2msLyUSJ63P gujZ4ExkgUBaZy6NCyzrdmCBNv2jKXh7X938e7plWFJ5UZeQheonGi7+SIM6M+4JxdJG rsUsg50bqc68RQ6hmtXN7Bs8SN72xxftswl5NAzgBFbp2num1Gab6Zqipa8BBpybl8PW lKeglb9vd9JIlDmEiU/2Tk6kQjHWgxHyCA7dFk1MknyD154e1ajBGeTg8HCYbRsZUONh eHmWp9ClP11QWCQjbW7qr0sldmIzMA4jHiECZRfCvo5DkoUKHmFueJaZ4glJ2d53IhgQ Plgg== 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=JrHcPBiJNMYY45TLfxTrdyg0kVvbbiEg2Yd8/X7ubpI=; fh=g6QfngWxyI9+6PUvfGrxmghjEe6uF3GkeHNILwG6GDU=; b=ay2Uy1ssoTc2gUSNbQUuClhPa1S2dIs4jkqpqrUAylhlqaqgub4ju9KvOvsAr4LM8s eGgNlvnVX7u10YgEFALcpNHhHMoffxxuZTm1OZAu74JPNG21AwkUHsA3///kHtFtoRcZ o3Fh6HEtm8sYtEk31z/ERXLC5FOkEKBoSjywEi2Mq4WahgD2B3ZVg+BUFaCcemk73mBB TxUfuLUdPQLK3fN1gDIkcii2NLtsnU13xqLzSpPflpaE2R0j/x44MgXV3sA0ue3x9AGe njTiT03fFx9AcrB6mAVmyMgPfAPLu+tviaRW/oYgO9YKr9Vr2QW7hmm7tRAjkgcPIItw G6ig==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vLYljU6K; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a1990732c6si1099627985a.529.2024.07.23.13.40.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jul 2024 13:40:34 -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=vLYljU6K; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWMIG-0004HS-Q9; Tue, 23 Jul 2024 16:39:32 -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 1sWMIE-0004Fp-S7 for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:39:30 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWMID-0003wT-69 for qemu-devel@nongnu.org; Tue, 23 Jul 2024 16:39:30 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-368313809a4so137311f8f.0 for ; Tue, 23 Jul 2024 13:39:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721767167; x=1722371967; 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=JrHcPBiJNMYY45TLfxTrdyg0kVvbbiEg2Yd8/X7ubpI=; b=vLYljU6KXnrrpDDMlpW/4g+AYy5/98gQ71OxWS2nmuk54PrgBezm2gdZjwHTDmQe3P SmXNg5ZPHRWvBs6anlEsM0PKwFK2kFcHj5mvw7MplDR3+ksQBsxl7QCfIDbkMryDYinr gk5fEMjBhhZYgDV01q7X/WZ4JE0C7jIUjF5Qrj18wC1unxIxI3ssafxFioGb004RzbjD vHgfWBuUuMw4ya2rrDrYKG605noriaUpUuFLK0e75pvYO6GJjbXK0n59r8ikOHm0ReUu zDjAlg5zjNmj29XTYOf0Un39jQM3QEJeKkmsMEtwfD6bCTNKOGGUY365ShFg+kuOpTBI Fdfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721767167; x=1722371967; 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=JrHcPBiJNMYY45TLfxTrdyg0kVvbbiEg2Yd8/X7ubpI=; b=LSZaTyTPBkWIDyOe7cvkY9gkqxZoMa9hcqeCGxKFsa7QgcRzIXVllkT0w5d2xQlG9Z x6gMrD0qt+QO2iDrJgkyA8HiJSqHx4sTsoNfRWSG2356ZJqNghaf3flNW/A3rd2dzggB 1w51y2nIC0kh8hyMmOWuKAP7wuLV8+E/gs728U42S+cNtfHpckZnDMvetOACF/GxGnBG lBuS9OY9qeSL9ziFbtDz8sTn4ltQnbZM98nO/zoQd5UEJx8822tm0+xEK+iLYBsi/1LC m+XGg+5oTGDV4aO0KMAmjDlggLOQM8Ro5sM5ZMOLMhM20/E7CgQA2E2MxmAFcaaftoku D0ug== X-Gm-Message-State: AOJu0YzDYntqyi3frD7ceH66g4JUbpSJt7UpWaoYTKWZ9E0lIs9ecLJ6 rwQGVBNRN3V8zgr/kBC+37BYta9Kho2lbfs8iWSeeaM7FuR7JYwM/RdkMt4TdI2Y0URMw8Mks5Z kI4U= X-Received: by 2002:a5d:6484:0:b0:368:37aa:50b3 with SMTP id ffacd0b85a97d-369e3f01536mr2976124f8f.24.1721767167398; Tue, 23 Jul 2024 13:39:27 -0700 (PDT) Received: from localhost.localdomain (vbo91-h01-176-184-50-4.dsl.sta.abo.bbox.fr. [176.184.50.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427f937f58dsm520255e9.18.2024.07.23.13.39.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jul 2024 13:39:26 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Song Gao , Richard Henderson , Jiaxun Yang Subject: [PULL 05/28] hw/intc/loongson_ipi: Declare QOM types using DEFINE_TYPES() macro Date: Tue, 23 Jul 2024 22:38:32 +0200 Message-ID: <20240723203855.65033-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240723203855.65033-1-philmd@linaro.org> References: <20240723203855.65033-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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 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. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Song Gao Reviewed-by: Richard Henderson Reviewed-by: Jiaxun Yang Tested-by: Jiaxun Yang Message-Id: <20240718133312.10324-2-philmd@linaro.org> --- hw/intc/loongson_ipi.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/hw/intc/loongson_ipi.c b/hw/intc/loongson_ipi.c index 4013f81745e..682cec96f3f 100644 --- a/hw/intc/loongson_ipi.c +++ b/hw/intc/loongson_ipi.c @@ -365,16 +365,13 @@ static void loongson_ipi_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_loongson_ipi; } -static const TypeInfo loongson_ipi_info = { - .name = TYPE_LOONGSON_IPI, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(LoongsonIPI), - .class_init = loongson_ipi_class_init, +static const TypeInfo loongson_ipi_types[] = { + { + .name = TYPE_LOONGSON_IPI, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(LoongsonIPI), + .class_init = loongson_ipi_class_init, + } }; -static void loongson_ipi_register_types(void) -{ - type_register_static(&loongson_ipi_info); -} - -type_init(loongson_ipi_register_types) +DEFINE_TYPES(loongson_ipi_types)