From patchwork Tue Nov 5 22:47: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: 840834 Delivered-To: patch@linaro.org Received: by 2002:a5d:6307:0:b0:381:e71e:8f7b with SMTP id i7csp240563wru; Tue, 5 Nov 2024 14:52:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWPJvjVb+SwDH5gfwGdCQt24qzoUsy5dzWbauEmuPXmWBH78UsItufpRz7zV2Pd/C2D/UPOhA==@linaro.org X-Google-Smtp-Source: AGHT+IGse7Xf0AtQ94C+tvJbB5Soy0oMboGohALX7oW1lF4tcCE83Bop8hfIBaNxliMIl0CszuII X-Received: by 2002:a05:6102:54ac:b0:4a3:cc16:e4db with SMTP id ada2fe7eead31-4a962f37033mr16821127137.27.1730847121394; Tue, 05 Nov 2024 14:52:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730847121; cv=none; d=google.com; s=arc-20240605; b=VC4ZRnuNhf36rN0ZMSvqzy0XOpRblbQ+UfPejOtPgiWPiZnxL3wg5FbJHPkq66esie /rsq5LnhCp4isqmU6gumS1ORmeOvYBuwmHZ1saXV72qnqtoeVZDevL9Sq7aWoZZo9PfT z2eUQEmWD8SsEuRn5Tl+itb3Z4lk1PxTrVzjLmoOhA7iMPMZDKWZZT1U32m/DNN7ElMf Wm2fzuCMdgntoq8inpdgY0ROk5+4OLrBtwtuajkTw2AL3MGeefOHKapezmFdx4rMvb38 /3j6U9BKcWsB1uAJ+NQND+o8w66nNHLH1gnKeEMSla8X8KJtXLSaRzL+irH1WZrrpuH2 YkEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=sKLOS9+H9ykYcRJyY9KVpn0N4yWwkY5/7pJAXitW7dc=; fh=pGYVoKmEbmBJXedzdvuKSuqi1EMwZm5z032l2+Fj52I=; b=C2j+7w3rXpVhqC/GcSmHlKb599jXTRxU8Bn8l8ilErWD89cXrDWc5KbrbVwHfn+Pjy ZbHZ6Eqd7xtjVXQQvXsTZLSVvnbImFZmKwr2emgv9NtbcJWpHIGuBjIA2usjoaB3XZ0f mghlCPhlGT5TlZRBR14kSai+qYk5LiwhTroc1N4atqOLfAleaPfXd5gG+x5pKDmtuFfM wiRjkx40cGYtpN/nBDuNCpEOwCaUsYlLXZwSp8BMDr1w1XHVHiVuMx6Y2x4pwUKssCAa xW5c8th9nHJsFt22p2FoM269UdO85m2xk+KTbxF8dy7Od2lPn419LYBH4NpufufzVp4S WHkA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OM9B2B42; 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 d75a77b69052e-462ad1b0f96si137473221cf.240.2024.11.05.14.52.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 14:52:01 -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=OM9B2B42; 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 1t8SNk-0002Mq-TZ; Tue, 05 Nov 2024 17:50:42 -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 1t8SN6-0001Dt-Tu for qemu-devel@nongnu.org; Tue, 05 Nov 2024 17:50:04 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8SN3-0004UV-9m for qemu-devel@nongnu.org; Tue, 05 Nov 2024 17:49:59 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-431616c23b5so1591125e9.0 for ; Tue, 05 Nov 2024 14:49:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730846996; x=1731451796; 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=sKLOS9+H9ykYcRJyY9KVpn0N4yWwkY5/7pJAXitW7dc=; b=OM9B2B42KjSIOcDD9vfZbZqwIu5p61jYNg1iGfq3M3wbTmHFVPmXYHjEbtthil8d+u C1Q+G+b+w5LOUdKamxu88bKrr60qKa7SXP50rdZQguw8UZShKgI3mXPVqsZ14K+os7SY WyG2ikJqrJ/2Op9AuFA7aMwnNHuSEUqYEbsJYWo9ePJrQTjDTvMfpzd5Vv7EWXHaBklf H3gZwW/O+DsQIYbMtW9rRP2N/0IalUSaim+ZvTxNFtj8FArGeL7L6D4MyJuSjLQ+pH0l AZ++xr6mvRm6QsawzWC9LEYFsB9sTTU/sb9uRQbK7tOdCYjg0sE3VlIx81rtVX416RyX 0plg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730846996; x=1731451796; 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=sKLOS9+H9ykYcRJyY9KVpn0N4yWwkY5/7pJAXitW7dc=; b=rF/IetIrbPgslp56Aiv6x9stk6crKMEfye8x9QxFu3kVKC7MA7Dk81sHoJ7pR/qMBd PUTK3wn/JxQ22iAYsPcV3j+fNDZq1TNrXahGCVtWfaN+/9JxVWXOKo51jZlnkbni3M8t iQemn8oTpiFe0j0iOq7rXZehOL8m52ZbrRtj8CP5oxkIiUrWxAjtZ7VbAqSfzjroC89A fdTo4W95TsupJcUqgSaKSvo4m32jAD9YVSGpxmcmlOXAKe7WPxU4HzdWKnS4Ou3n7ZSc 40bdwv6puFJpPtVHvxn95ON6X4/TriIS7onq/2JvleCaljuZ5IMbTaiUt6pEiNGJvpon ijWw== X-Gm-Message-State: AOJu0Yy3MXEd0NERlTu9cAlcP9ikWbPtTM8GsIpxgCvLu0bK/F69qsXB NzmCOIbZCqkKd/DHrcYMBHVKOmWphua46nJzZyJi7TfX/Xrh4NbV9wLmGl1He2dc6pBR+31BFO6 yCcWnDw== X-Received: by 2002:a05:600c:511a:b0:424:895c:b84b with SMTP id 5b1f17b1804b1-432a9a8c882mr3056455e9.4.1730846995652; Tue, 05 Nov 2024 14:49:55 -0800 (PST) Received: from localhost.localdomain ([89.101.134.25]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432aa6bee9asm1097045e9.19.2024.11.05.14.49.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Nov 2024 14:49:55 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PULL 27/29] hw/rtc/ds1338: Prefer DEFINE_TYPES() macro Date: Tue, 5 Nov 2024 22:47:25 +0000 Message-ID: <20241105224727.53059-28-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241105224727.53059-1-philmd@linaro.org> References: <20241105224727.53059-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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 From: Bernhard Beschow Signed-off-by: Bernhard Beschow Message-ID: <20241103133412.73536-24-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/rtc/ds1338.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/hw/rtc/ds1338.c b/hw/rtc/ds1338.c index a5fe2214184..13472c56703 100644 --- a/hw/rtc/ds1338.c +++ b/hw/rtc/ds1338.c @@ -14,7 +14,6 @@ #include "hw/i2c/i2c.h" #include "migration/vmstate.h" #include "qemu/bcd.h" -#include "qemu/module.h" #include "qom/object.h" #include "sysemu/rtc.h" @@ -227,16 +226,13 @@ static void ds1338_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_ds1338; } -static const TypeInfo ds1338_info = { - .name = TYPE_DS1338, - .parent = TYPE_I2C_SLAVE, - .instance_size = sizeof(DS1338State), - .class_init = ds1338_class_init, +static const TypeInfo ds1338_types[] = { + { + .name = TYPE_DS1338, + .parent = TYPE_I2C_SLAVE, + .instance_size = sizeof(DS1338State), + .class_init = ds1338_class_init, + }, }; -static void ds1338_register_types(void) -{ - type_register_static(&ds1338_info); -} - -type_init(ds1338_register_types) +DEFINE_TYPES(ds1338_types)