hwmon: constify struct regmap_config
Subsystems (3)
cover hwmon: constify struct regmap_config
This series adds the const modifier to the remaining regmap_config structs within the hwmon subsystem that are effectively used as const (i.e., only read after their declaration), but kept ad writtable data.
---
Javier Carrasco (3):
hwmon: (ina238) Constify struct regmap_config
hwmon: (tmp513) Constify struct regmap_config
hwmon: (tps23861) Constify struct regmap_config
drivers/hwmon/ina238.c | 2 +- drivers/hwmon/tmp513.c | 2 +- drivers/hwmon/tps23861.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
---
base-commit: 39b24cced70fdc336dbc0070f8b3bde61d8513a8
change-id: 20240702-hwmon-const-regmap-4d4e3c097d9e
Best regards,
Signature · 1 line
Javier Carrasco <[email protected]>
PATCH 1/3 hwmon: (ina238) Constify struct regmap_config
ina238_regmap_config is not modified and can be declared as const to move its data to a read-only section.
--- drivers/hwmon/ina238.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/ina238.c +1 -1
@@ -96,7 +96,7 @@#define INA238_BUS_VOLTAGE_LSB 3125/* 3.125 mV/lsb */ #define INA238_DIE_TEMP_LSB 125/* 125 mC/lsb */ -static struct regmap_config ina238_regmap_config = { +static const struct regmap_config ina238_regmap_config = { .max_register =INA238_REGISTERS , .reg_bits =8 , .val_bits =16 ,
Signature · 1 line
2.40.1
Re: [PATCH 1/3] hwmon: (ina238) Constify struct regmap_config
Quoted 4 lines · Javier Carrasco
ina238_regmap_configis not modified and can be declared as const to move its data to a read-only section.Signed-off-by Javier Carrasco <[email protected]>
Applied.
Thanks,
Guenter
PATCH 2/3 hwmon: (tmp513) Constify struct regmap_config
In reply to Javier Carrascotmp51x_regmap_config is not modified and can be declared as const to move its data to a read-only section.
--- drivers/hwmon/tmp513.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/tmp513.c +1 -1
@@ -159,7 +159,7 @@ static const u8 TMP51X_CURR_INPUT[2] = {TMP51X_BUS_CURRENT_RESULT }; -static struct regmap_config tmp51x_regmap_config = { +static const struct regmap_config tmp51x_regmap_config = { .reg_bits =8 , .val_bits =16 , .max_register =TMP51X_MAX_REGISTER_ADDR ,
Signature · 1 line
2.40.1
Re: [PATCH 2/3] hwmon: (tmp513) Constify struct regmap_config
Quoted 4 lines · Javier Carrasco
tmp51x_regmap_configis not modified and can be declared as const to move its data to a read-only section.Signed-off-by Javier Carrasco <[email protected]>
Applied.
Thanks,
Guenter
PATCH 3/3 hwmon: (tps23861) Constify struct regmap_config
In reply to Javier Carrascotps23861_regmap_config is not modified and can be declared as const to move its data to a read-only section.
--- drivers/hwmon/tps23861.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/tps23861.c +1 -1
@@ -117,7 +117,7 @@ struct tps23861_data {struct dentry *debugfs_dir; }; -static struct regmap_config tps23861_regmap_config = { +static const struct regmap_config tps23861_regmap_config = { .reg_bits =8 , .val_bits =8 , .max_register =0x6f ,
Signature · 1 line
2.40.1
Re: [PATCH 3/3] hwmon: (tps23861) Constify struct regmap_config
Quoted 4 lines · Javier Carrasco
tps23861_regmap_configis not modified and can be declared as const to move its data to a read-only section.Signed-off-by Javier Carrasco <[email protected]>
Applied.
Thanks,
Guenter