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 06/11] hw: Declare various const data as 'const'
Date: Mon, 10 Feb 2025 14:31:29 +0100 [thread overview]
Message-ID: <20250210133134.90879-7-philmd@linaro.org> (raw)
In-Reply-To: <20250210133134.90879-1-philmd@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/isa/vt82c686.c | 2 +-
hw/rtc/m48t59-isa.c | 2 +-
hw/rtc/m48t59.c | 2 +-
hw/sensor/tmp421.c | 2 +-
hw/usb/hcd-ehci-pci.c | 2 +-
hw/usb/hcd-uhci.c | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
index 6f44b381a5f..43bd67eeef2 100644
--- a/hw/isa/vt82c686.c
+++ b/hw/isa/vt82c686.c
@@ -224,7 +224,7 @@ static void via_pm_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
- ViaPMInitInfo *info = data;
+ const ViaPMInitInfo *info = data;
k->realize = via_pm_realize;
k->config_write = pm_write_config;
diff --git a/hw/rtc/m48t59-isa.c b/hw/rtc/m48t59-isa.c
index 38bc8dcf100..9c3855a3ef1 100644
--- a/hw/rtc/m48t59-isa.c
+++ b/hw/rtc/m48t59-isa.c
@@ -129,7 +129,7 @@ static void m48txx_isa_class_init(ObjectClass *klass, void *data)
static void m48txx_isa_concrete_class_init(ObjectClass *klass, void *data)
{
M48txxISADeviceClass *u = M48TXX_ISA_CLASS(klass);
- M48txxInfo *info = data;
+ const M48txxInfo *info = data;
u->info = *info;
}
diff --git a/hw/rtc/m48t59.c b/hw/rtc/m48t59.c
index c9bd6f878fe..3fb2f27d9d1 100644
--- a/hw/rtc/m48t59.c
+++ b/hw/rtc/m48t59.c
@@ -639,7 +639,7 @@ static void m48txx_sysbus_class_init(ObjectClass *klass, void *data)
static void m48txx_sysbus_concrete_class_init(ObjectClass *klass, void *data)
{
M48txxSysBusDeviceClass *u = M48TXX_SYS_BUS_CLASS(klass);
- M48txxInfo *info = data;
+ const M48txxInfo *info = data;
u->info = *info;
}
diff --git a/hw/sensor/tmp421.c b/hw/sensor/tmp421.c
index 82e604279c5..007f7cd018b 100644
--- a/hw/sensor/tmp421.c
+++ b/hw/sensor/tmp421.c
@@ -68,7 +68,7 @@ struct TMP421State {
struct TMP421Class {
I2CSlaveClass parent_class;
- DeviceInfo *dev;
+ const DeviceInfo *dev;
};
#define TYPE_TMP421 "tmp421-generic"
diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c
index d410c38a8a2..e00316721ac 100644
--- a/hw/usb/hcd-ehci-pci.c
+++ b/hw/usb/hcd-ehci-pci.c
@@ -182,7 +182,7 @@ static void ehci_data_class_init(ObjectClass *klass, void *data)
{
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
DeviceClass *dc = DEVICE_CLASS(klass);
- EHCIPCIInfo *i = data;
+ const EHCIPCIInfo *i = data;
k->vendor_id = i->vendor_id;
k->device_id = i->device_id;
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index 8528d493d63..0561a6d801a 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -1289,7 +1289,7 @@ void uhci_data_class_init(ObjectClass *klass, void *data)
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
DeviceClass *dc = DEVICE_CLASS(klass);
UHCIPCIDeviceClass *u = UHCI_CLASS(klass);
- UHCIInfo *info = data;
+ const UHCIInfo *info = data;
k->realize = info->realize ? info->realize : usb_uhci_common_realize;
k->exit = info->unplug ? usb_uhci_exit : NULL;
--
2.47.1
next prev parent reply other threads:[~2025-02-10 13:33 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 ` Philippe Mathieu-Daudé [this message]
2025-02-10 16:35 ` [PATCH v2 06/11] hw: Declare various const data as 'const' Richard Henderson
2025-02-10 13:31 ` [PATCH v2 07/11] hw: Make class data 'const' Philippe Mathieu-Daudé
2025-02-10 16:36 ` 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-7-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).