Skip to content

Commit

Permalink
hw: Make class data 'const'
Browse files Browse the repository at this point in the history
When the %data argument is not modified, we can declare it const.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-Id: <[email protected]>
  • Loading branch information
philmd committed Feb 16, 2025
1 parent d31f118 commit 788369f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion hw/sd/sdhci-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion hw/sd/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion hw/sensor/emc141x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion hw/sensor/isl_pmbus_vr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 788369f

Please sign in to comment.