* [PATCH 0/3] hwmon: constify struct regmap_config
@ 2024-07-02 10:09 Javier Carrasco
2024-07-02 10:09 ` [PATCH 1/3] hwmon: (ina238) Constify " Javier Carrasco
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Javier Carrasco @ 2024-07-02 10:09 UTC (permalink / raw)
To: Jean Delvare, Guenter Roeck, Eric Tremblay, Robert Marko,
Luka Perkov
Cc: linux-hwmon, linux-kernel, Javier Carrasco
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.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
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,
--
Javier Carrasco <javier.carrasco.cruz@gmail.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] hwmon: (ina238) Constify struct regmap_config
2024-07-02 10:09 [PATCH 0/3] hwmon: constify struct regmap_config Javier Carrasco
@ 2024-07-02 10:09 ` Javier Carrasco
2024-07-02 18:30 ` Guenter Roeck
2024-07-02 10:09 ` [PATCH 2/3] hwmon: (tmp513) " Javier Carrasco
2024-07-02 10:09 ` [PATCH 3/3] hwmon: (tps23861) " Javier Carrasco
2 siblings, 1 reply; 7+ messages in thread
From: Javier Carrasco @ 2024-07-02 10:09 UTC (permalink / raw)
To: Jean Delvare, Guenter Roeck, Eric Tremblay, Robert Marko,
Luka Perkov
Cc: linux-hwmon, linux-kernel, Javier Carrasco
`ina238_regmap_config` is not modified and can be declared as const to
move its data to a read-only section.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
drivers/hwmon/ina238.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/ina238.c b/drivers/hwmon/ina238.c
index 855626f1bc01..2d9f12f68d50 100644
--- a/drivers/hwmon/ina238.c
+++ b/drivers/hwmon/ina238.c
@@ -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,
--
2.40.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] hwmon: (tmp513) Constify struct regmap_config
2024-07-02 10:09 [PATCH 0/3] hwmon: constify struct regmap_config Javier Carrasco
2024-07-02 10:09 ` [PATCH 1/3] hwmon: (ina238) Constify " Javier Carrasco
@ 2024-07-02 10:09 ` Javier Carrasco
2024-07-02 18:31 ` Guenter Roeck
2024-07-02 10:09 ` [PATCH 3/3] hwmon: (tps23861) " Javier Carrasco
2 siblings, 1 reply; 7+ messages in thread
From: Javier Carrasco @ 2024-07-02 10:09 UTC (permalink / raw)
To: Jean Delvare, Guenter Roeck, Eric Tremblay, Robert Marko,
Luka Perkov
Cc: linux-hwmon, linux-kernel, Javier Carrasco
`tmp51x_regmap_config` is not modified and can be declared as const to
move its data to a read-only section.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
drivers/hwmon/tmp513.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/tmp513.c b/drivers/hwmon/tmp513.c
index ea6f4416c124..926d28cd3fab 100644
--- a/drivers/hwmon/tmp513.c
+++ b/drivers/hwmon/tmp513.c
@@ -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,
--
2.40.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] hwmon: (tps23861) Constify struct regmap_config
2024-07-02 10:09 [PATCH 0/3] hwmon: constify struct regmap_config Javier Carrasco
2024-07-02 10:09 ` [PATCH 1/3] hwmon: (ina238) Constify " Javier Carrasco
2024-07-02 10:09 ` [PATCH 2/3] hwmon: (tmp513) " Javier Carrasco
@ 2024-07-02 10:09 ` Javier Carrasco
2024-07-02 18:31 ` Guenter Roeck
2 siblings, 1 reply; 7+ messages in thread
From: Javier Carrasco @ 2024-07-02 10:09 UTC (permalink / raw)
To: Jean Delvare, Guenter Roeck, Eric Tremblay, Robert Marko,
Luka Perkov
Cc: linux-hwmon, linux-kernel, Javier Carrasco
`tps23861_regmap_config` is not modified and can be declared as const to
move its data to a read-only section.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
drivers/hwmon/tps23861.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/tps23861.c b/drivers/hwmon/tps23861.c
index d33ecbac00d6..dfcfb09d9f3c 100644
--- a/drivers/hwmon/tps23861.c
+++ b/drivers/hwmon/tps23861.c
@@ -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,
--
2.40.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] hwmon: (ina238) Constify struct regmap_config
2024-07-02 10:09 ` [PATCH 1/3] hwmon: (ina238) Constify " Javier Carrasco
@ 2024-07-02 18:30 ` Guenter Roeck
0 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2024-07-02 18:30 UTC (permalink / raw)
To: Javier Carrasco
Cc: Jean Delvare, Eric Tremblay, Robert Marko, Luka Perkov,
linux-hwmon, linux-kernel
On Tue, Jul 02, 2024 at 12:09:30PM +0200, Javier Carrasco wrote:
> `ina238_regmap_config` is not modified and can be declared as const to
> move its data to a read-only section.
>
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Applied.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] hwmon: (tmp513) Constify struct regmap_config
2024-07-02 10:09 ` [PATCH 2/3] hwmon: (tmp513) " Javier Carrasco
@ 2024-07-02 18:31 ` Guenter Roeck
0 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2024-07-02 18:31 UTC (permalink / raw)
To: Javier Carrasco
Cc: Jean Delvare, Eric Tremblay, Robert Marko, Luka Perkov,
linux-hwmon, linux-kernel
On Tue, Jul 02, 2024 at 12:09:31PM +0200, Javier Carrasco wrote:
> `tmp51x_regmap_config` is not modified and can be declared as const to
> move its data to a read-only section.
>
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Applied.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] hwmon: (tps23861) Constify struct regmap_config
2024-07-02 10:09 ` [PATCH 3/3] hwmon: (tps23861) " Javier Carrasco
@ 2024-07-02 18:31 ` Guenter Roeck
0 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2024-07-02 18:31 UTC (permalink / raw)
To: Javier Carrasco
Cc: Jean Delvare, Eric Tremblay, Robert Marko, Luka Perkov,
linux-hwmon, linux-kernel
On Tue, Jul 02, 2024 at 12:09:32PM +0200, Javier Carrasco wrote:
> `tps23861_regmap_config` is not modified and can be declared as const to
> move its data to a read-only section.
>
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Applied.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-07-02 18:31 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-02 10:09 [PATCH 0/3] hwmon: constify struct regmap_config Javier Carrasco
2024-07-02 10:09 ` [PATCH 1/3] hwmon: (ina238) Constify " Javier Carrasco
2024-07-02 18:30 ` Guenter Roeck
2024-07-02 10:09 ` [PATCH 2/3] hwmon: (tmp513) " Javier Carrasco
2024-07-02 18:31 ` Guenter Roeck
2024-07-02 10:09 ` [PATCH 3/3] hwmon: (tps23861) " Javier Carrasco
2024-07-02 18:31 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox