From patchwork Thu Jul 18 08:38:25 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: 813135 Delivered-To: patch@linaro.org Received: by 2002:adf:f288:0:b0:367:895a:4699 with SMTP id k8csp188517wro; Thu, 18 Jul 2024 01:39:47 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXpdM12H1nuizST6J8scghwOiGqifshOZDC8YxAlBZuFrCypn23aOJMcpnyussksHiEyoQJiJfI5J2gj7CCyVKB X-Google-Smtp-Source: AGHT+IGKswR1O7ABFmXMpbeOdp4Pgs9ba1fFTLoAdlJgBe4CTkUEYKgbB5o4YF9qIo2WRKzoKDFt X-Received: by 2002:a05:6102:2c04:b0:48f:3fe0:34de with SMTP id ada2fe7eead31-491597f355bmr6080529137.11.1721291987532; Thu, 18 Jul 2024 01:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721291987; cv=none; d=google.com; s=arc-20160816; b=qMq4c7i+JyXpmXZEzXiQKcA4zpcVd8VqGw+MpWsmE13EeGHOWj/TMvUv8JMLsfIXU0 dSZIjCQsBVJxVw+VOEHWj8HMIOJxs+I2uZgJQPKLT2Yn5BD0uy+F1SjORoBDnOU6O+1b jepm7sUMMf9iin8Ih7v++DejSIOvpNxU/9RugmF1J//wl5j921OnUT8Dnhh0TWsSYPXI Lmd9BV7BnL4ukRcTqxgktcHVQ9fheKlYwDTHsEfQ5VbYrHyy/MChhjvfiZ6G7O2fl15r 1KPv339jNSAcY8A8ILBQu412QA4BA2pa8IOPWFjtZwEpRqxqc0fn8sHmF4S4+P/UQqze LVMg== 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=9ZkYqvJBN+Ms+VQxfxYaIWgzMBdCSAtS0DZxHKASYzs=; fh=NLZWUfvz+g+MnoIWE6nGov3chqHrPo6wetxAC/CDqtI=; b=Ni49oEN8k+cEgrIYDxUeCREx0pSdyxHV/9q4OW45BrsaKpt5wLJuus3d/J6FGyG3df 4rFKf5no02X5JaRHY4b2Bp2TfYpFRfsbrWsaxBr8Zx+77K6u9IjjI0od4c2hbmTXVafS XwScdJGXXTfnSzEh539aVcmDkQwG74gU1N5BFlFzEMo5yWsyeMOQXmltxxv8PNxFZ+cs gGKQykVa3jSlKXib7OLkuDPskliJ6WmsGMUefChNwoKfX8/OzUnAewmIGbruvdcpNJXm yEriP5qBnuJrZTiqghwJaHBu51HVQr7s1X1h7OTe3X4KFikxKh2HsriGs+c7hp3QChRD HTiw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vb8YuQkV; 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 6a1803df08f44-6b79ca94631si14820026d6.608.2024.07.18.01.39.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Jul 2024 01:39:47 -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=Vb8YuQkV; 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 1sUMfD-0001Ju-J7; Thu, 18 Jul 2024 04:38:59 -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 1sUMfC-0001DH-9D for qemu-devel@nongnu.org; Thu, 18 Jul 2024 04:38:58 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sUMfA-0004gQ-LA for qemu-devel@nongnu.org; Thu, 18 Jul 2024 04:38:58 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4266fd395eeso420005e9.3 for ; Thu, 18 Jul 2024 01:38:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721291934; x=1721896734; 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=9ZkYqvJBN+Ms+VQxfxYaIWgzMBdCSAtS0DZxHKASYzs=; b=Vb8YuQkVa34ngOnrdB+7Gng8mXDOdjQfkcZBxz4uMIhAVrf+aYuY7um68nZgCQlAS+ cIGq+fuxTiKoGq4OrwOZs4F6/uc+XG3z8qtRfjBGdPzXsMknwgJNjyRh3IX52Kgang8M R7NRSlm7qTMHEBC5BK406IZecKnmv61QpdD5gbb7ytaNpIOnFAGENEUvUiU+bNHI/NvV oMdPR+8xrA22qCiIfunUUrYihWIRTpC8PG3JdldB8zGwBVavhZox4bUxiYRGTNJZACpA wOiQ7Yld1NEYozwghKCUSADWIL6NTEU/DXdQmJTZs9OUaEYLnHgFqPK0B52PZp065QSa rCMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721291934; x=1721896734; 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=9ZkYqvJBN+Ms+VQxfxYaIWgzMBdCSAtS0DZxHKASYzs=; b=PjDrCzJID5zc9p5WsOhEvRciYwRY1uxK0k9wmP0hsifFXhmcP6Ljoz5aI08hC2xGzb mDfKut6ZFFUlpws1Xfup2/3QoCeISGjG3v0AytFW/9ekYqatDB929S/UXhwQSqKftuXx SG662jDgZntTIcKw8jjW30msSHzhlyML44kZ5p8MmY2ZaPaPhg1AXk6nj6b0zNYyZraa wma/zgRvx/SYPdIAEqGwrFAzrsRk99/3wLEu09ZfDubChv3yxiMacsnFInV/3OzbZu5r zh98oVf+kaCnwH7dlbhyAvDEXeggyWOMYYFrJhLYsQmQZhneUzAk5tuneKhwTz3Ma7/0 sIYQ== X-Gm-Message-State: AOJu0YwajY+Rzvrhj4lpFjndaFWiv7CEkWtSb7VcD+QYJPwtjjVw48Ms QF6QTEFqtKhUZeYXoYiwSzF3bQV+PWZUTrl3jIjbChx+/L8HysYc0OaQsViF/y38YTI2myZcHcW 6m8xkWA== X-Received: by 2002:a05:6000:2c8:b0:367:9639:66d3 with SMTP id ffacd0b85a97d-368315f3344mr3042164f8f.5.1721291934679; Thu, 18 Jul 2024 01:38:54 -0700 (PDT) Received: from localhost.localdomain ([176.187.208.21]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36853e239cfsm954342f8f.56.2024.07.18.01.38.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 18 Jul 2024 01:38:54 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Bibo Mao , Jiaxun Yang Cc: Song Gao , Xianglai Li , Huacai Chen , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Xiaojuan Yang , Paolo Bonzini Subject: [PATCH v4 01/18] hw/intc/loongson_ipi: Declare QOM types using DEFINE_TYPES() macro Date: Thu, 18 Jul 2024 10:38:25 +0200 Message-ID: <20240718083842.81199-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240718083842.81199-1-philmd@linaro.org> References: <20240718083842.81199-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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é Reviewed-by: Richard Henderson --- hw/intc/loongson_ipi.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/hw/intc/loongson_ipi.c b/hw/intc/loongson_ipi.c index e6a7142480..dc82caea0d 100644 --- a/hw/intc/loongson_ipi.c +++ b/hw/intc/loongson_ipi.c @@ -363,17 +363,14 @@ static void loongson_ipi_finalize(Object *obj) g_free(s->cpu); } -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, - .instance_finalize = loongson_ipi_finalize, +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, + .instance_finalize = loongson_ipi_finalize, + } }; -static void loongson_ipi_register_types(void) -{ - type_register_static(&loongson_ipi_info); -} - -type_init(loongson_ipi_register_types) +DEFINE_TYPES(loongson_ipi_types)