summary refs log tree commit diff stats
path: root/include/hw
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2025-02-09 23:47:35 +0100
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2025-04-25 17:00:41 +0200
commit12d1a768bdfea6e27a3a829228840d72507613a1 (patch)
tree1293456896e507c4dcb859197ccafa0719aa7f65 /include/hw
parentf1fa787b92c52d1034de164d2a26771ff969454e (diff)
downloadfocaccia-qemu-12d1a768bdfea6e27a3a829228840d72507613a1.tar.gz
focaccia-qemu-12d1a768bdfea6e27a3a829228840d72507613a1.zip
qom: Have class_init() take a const data argument
Mechanical change using gsed, then style manually adapted
to pass checkpatch.pl script.

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250424194905.82506-4-philmd@linaro.org>
Diffstat (limited to 'include/hw')
-rw-r--r--include/hw/boards.h2
-rw-r--r--include/hw/i386/pc.h5
-rw-r--r--include/hw/virtio/virtio-pci.h2
3 files changed, 5 insertions, 4 deletions
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 8556e01e21..765dc8dd35 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -745,7 +745,7 @@ struct MachineState {
     } while (0)
 
 #define DEFINE_MACHINE(namestr, machine_initfn) \
-    static void machine_initfn##_class_init(ObjectClass *oc, void *data) \
+    static void machine_initfn##_class_init(ObjectClass *oc, const void *data) \
     { \
         MachineClass *mc = MACHINE_CLASS(oc); \
         machine_initfn(mc); \
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 8677dc8950..9563674e2d 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -306,7 +306,8 @@ extern GlobalProperty pc_compat_2_4[];
 extern const size_t pc_compat_2_4_len;
 
 #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \
-    static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \
+    static void pc_machine_##suffix##_class_init(ObjectClass *oc, \
+                                                 const void *data) \
     { \
         MachineClass *mc = MACHINE_CLASS(oc); \
         optsfn(mc); \
@@ -331,7 +332,7 @@ extern const size_t pc_compat_2_4_len;
     } \
     static void MACHINE_VER_SYM(class_init, namesym, __VA_ARGS__)( \
         ObjectClass *oc, \
-        void *data) \
+        const void *data) \
     { \
         MachineClass *mc = MACHINE_CLASS(oc); \
         MACHINE_VER_SYM(options, namesym, __VA_ARGS__)(mc); \
diff --git a/include/hw/virtio/virtio-pci.h b/include/hw/virtio/virtio-pci.h
index 971c5fabd4..567a9b0a9d 100644
--- a/include/hw/virtio/virtio-pci.h
+++ b/include/hw/virtio/virtio-pci.h
@@ -255,7 +255,7 @@ typedef struct VirtioPCIDeviceTypeInfo {
     size_t class_size;
     void (*instance_init)(Object *obj);
     void (*instance_finalize)(Object *obj);
-    void (*class_init)(ObjectClass *klass, void *data);
+    void (*class_init)(ObjectClass *klass, const void *data);
     InterfaceInfo *interfaces;
 } VirtioPCIDeviceTypeInfo;