From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH v2 07/11] hw: Make class data 'const'
Date: Mon, 10 Feb 2025 14:31:30 +0100 [thread overview]
Message-ID: <20250210133134.90879-8-philmd@linaro.org> (raw)
In-Reply-To: <20250210133134.90879-1-philmd@linaro.org>
When the %data argument is not modified, we can declare it const.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/sd/sdhci-internal.h | 2 +-
hw/sd/sdhci.c | 2 +-
hw/sensor/emc141x.c | 2 +-
hw/sensor/isl_pmbus_vr.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/sd/sdhci-internal.h b/hw/sd/sdhci-internal.h
index 5f3765f12d2..9f768c418e0 100644
--- a/hw/sd/sdhci-internal.h
+++ b/hw/sd/sdhci-internal.h
@@ -322,6 +322,6 @@ void sdhci_initfn(SDHCIState *s);
void sdhci_uninitfn(SDHCIState *s);
void sdhci_common_realize(SDHCIState *s, Error **errp);
void sdhci_common_unrealize(SDHCIState *s);
-void sdhci_common_class_init(ObjectClass *klass, void *data);
+void sdhci_common_class_init(ObjectClass *klass, const void *data);
#endif
diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index 99dd4a4e952..1f45a77566c 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -1542,7 +1542,7 @@ const VMStateDescription sdhci_vmstate = {
},
};
-void sdhci_common_class_init(ObjectClass *klass, void *data)
+void sdhci_common_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
diff --git a/hw/sensor/emc141x.c b/hw/sensor/emc141x.c
index aeccd2a3c94..33c1bd330fd 100644
--- a/hw/sensor/emc141x.c
+++ b/hw/sensor/emc141x.c
@@ -265,7 +265,7 @@ static void emc141x_initfn(Object *obj)
emc141x_set_temperature, NULL, NULL);
}
-static void emc141x_class_init(ObjectClass *klass, void *data)
+static void emc141x_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
I2CSlaveClass *k = I2C_SLAVE_CLASS(klass);
diff --git a/hw/sensor/isl_pmbus_vr.c b/hw/sensor/isl_pmbus_vr.c
index 304a66ea8b0..c60282cfe77 100644
--- a/hw/sensor/isl_pmbus_vr.c
+++ b/hw/sensor/isl_pmbus_vr.c
@@ -233,7 +233,7 @@ static void raa228000_init(Object *obj)
isl_pmbus_vr_add_props(obj, flags, 1);
}
-static void isl_pmbus_vr_class_init(ObjectClass *klass, void *data,
+static void isl_pmbus_vr_class_init(ObjectClass *klass, const void *data,
uint8_t pages)
{
PMBusDeviceClass *k = PMBUS_DEVICE_CLASS(klass);
--
2.47.1
next prev parent reply other threads:[~2025-02-10 13:35 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-10 13:31 [PATCH v2 00/11] qom: Constify class_data Philippe Mathieu-Daudé
2025-02-10 13:31 ` [PATCH v2 01/11] target/i386: Constify X86CPUModel uses Philippe Mathieu-Daudé
2025-02-10 16:30 ` Richard Henderson
2025-02-10 13:31 ` [PATCH v2 02/11] target/sparc: Constify SPARCCPUClass::cpu_def Philippe Mathieu-Daudé
2025-02-10 16:30 ` Richard Henderson
2025-02-10 13:31 ` [PATCH v2 03/11] target/xtensa: Finalize config in xtensa_register_core() Philippe Mathieu-Daudé
2025-02-10 16:30 ` Richard Henderson
2025-02-10 17:02 ` Max Filippov
2025-02-10 13:31 ` [PATCH v2 04/11] target/riscv: Declare RISCVCPUClass::misa_mxl_max as RISCVMXL Philippe Mathieu-Daudé
2025-02-10 16:31 ` Richard Henderson
2025-02-10 13:31 ` [PATCH v2 05/11] target/riscv: Convert misa_mxl_max using GLib macros Philippe Mathieu-Daudé
2025-02-10 16:34 ` Richard Henderson
2025-02-10 13:31 ` [PATCH v2 06/11] hw: Declare various const data as 'const' Philippe Mathieu-Daudé
2025-02-10 16:35 ` Richard Henderson
2025-02-10 13:31 ` Philippe Mathieu-Daudé [this message]
2025-02-10 16:36 ` [PATCH v2 07/11] hw: Make class data 'const' Richard Henderson
2025-02-10 13:31 ` [PATCH v2 08/11] qom: Have class_base_init() take a const data argument Philippe Mathieu-Daudé
2025-02-10 16:36 ` Richard Henderson
2025-02-10 13:31 ` [PATCH v2 09/11] qom: Have class_init() " Philippe Mathieu-Daudé
2025-02-10 16:51 ` Richard Henderson
2025-02-10 17:22 ` Philippe Mathieu-Daudé
2025-02-10 13:31 ` [PATCH v2 10/11] qom: Constify TypeInfo::class_data Philippe Mathieu-Daudé
2025-02-10 16:54 ` Richard Henderson
2025-02-10 13:31 ` [PATCH v2 11/11] qom: Constify InterfaceInfo[] interfaces Philippe Mathieu-Daudé
2025-02-10 16:55 ` Richard Henderson
2025-02-10 13:46 ` [PATCH v2 00/11] qom: Constify class_data Philippe Mathieu-Daudé
2025-02-10 17:02 ` Richard Henderson
2025-02-10 17:21 ` Philippe Mathieu-Daudé
2025-03-06 13:16 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250210133134.90879-8-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).