2023-05-11 18:02:35

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [RESEND PATCH 1/4] rtc: ab-eoz9: constify pointers to hwmon_channel_info

Statically allocated array of pointers to hwmon_channel_info can be made
const for safety.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/rtc/rtc-ab-eoz9.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-ab-eoz9.c b/drivers/rtc/rtc-ab-eoz9.c
index 34611f6dedcb..143650cb7822 100644
--- a/drivers/rtc/rtc-ab-eoz9.c
+++ b/drivers/rtc/rtc-ab-eoz9.c
@@ -455,7 +455,7 @@ static const struct hwmon_channel_info abeoz9_temp = {
.config = abeoz9_temp_config,
};

-static const struct hwmon_channel_info *abeoz9_info[] = {
+static const struct hwmon_channel_info * const abeoz9_info[] = {
&abeoz9_chip,
&abeoz9_temp,
NULL
--
2.34.1



2023-05-11 18:02:39

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [RESEND PATCH 2/4] rtc: ds3232: constify pointers to hwmon_channel_info

Statically allocated array of pointers to hwmon_channel_info can be made
const for safety.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/rtc/rtc-ds3232.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-ds3232.c b/drivers/rtc/rtc-ds3232.c
index dd31a60c1fc6..ce46016c9fd8 100644
--- a/drivers/rtc/rtc-ds3232.c
+++ b/drivers/rtc/rtc-ds3232.c
@@ -359,7 +359,7 @@ static const struct hwmon_channel_info ds3232_hwmon_temp = {
.config = ds3232_hwmon_temp_config,
};

-static const struct hwmon_channel_info *ds3232_hwmon_info[] = {
+static const struct hwmon_channel_info * const ds3232_hwmon_info[] = {
&ds3232_hwmon_chip,
&ds3232_hwmon_temp,
NULL
--
2.34.1


2023-05-11 18:02:40

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [RESEND PATCH 3/4] rtc: isl12022: constify pointers to hwmon_channel_info

Statically allocated array of pointers to hwmon_channel_info can be made
const for safety.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/rtc/rtc-isl12022.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-isl12022.c b/drivers/rtc/rtc-isl12022.c
index e68a79b5e00e..eef66453841f 100644
--- a/drivers/rtc/rtc-isl12022.c
+++ b/drivers/rtc/rtc-isl12022.c
@@ -89,7 +89,7 @@ static int isl12022_hwmon_read(struct device *dev,
return -EOPNOTSUPP;
}

-static const struct hwmon_channel_info *isl12022_hwmon_info[] = {
+static const struct hwmon_channel_info * const isl12022_hwmon_info[] = {
HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT),
NULL
};
--
2.34.1


2023-05-11 18:02:42

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [RESEND PATCH 4/4] rtc: rv3032: constify pointers to hwmon_channel_info

Statically allocated array of pointers to hwmon_channel_info can be made
const for safety.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/rtc/rtc-rv3032.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-rv3032.c b/drivers/rtc/rtc-rv3032.c
index 1ff4f2e6fa77..7b36e7f125f7 100644
--- a/drivers/rtc/rtc-rv3032.c
+++ b/drivers/rtc/rtc-rv3032.c
@@ -842,7 +842,7 @@ static int rv3032_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
return err;
}

-static const struct hwmon_channel_info *rv3032_hwmon_info[] = {
+static const struct hwmon_channel_info * const rv3032_hwmon_info[] = {
HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ),
HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MAX_HYST),
NULL
--
2.34.1


2023-06-06 22:03:15

by Alexandre Belloni

[permalink] [raw]
Subject: Re: [RESEND PATCH 1/4] rtc: ab-eoz9: constify pointers to hwmon_channel_info


On Thu, 11 May 2023 19:56:06 +0200, Krzysztof Kozlowski wrote:
> Statically allocated array of pointers to hwmon_channel_info can be made
> const for safety.
>
>

Applied, thanks!

[1/4] rtc: ab-eoz9: constify pointers to hwmon_channel_info
commit: 973ef08456f8c6aea4672ae986dfe907b9e4fdc3
[2/4] rtc: ds3232: constify pointers to hwmon_channel_info
commit: d00caa55cecd3e833c21c9372fc558cb9f40a07f
[3/4] rtc: isl12022: constify pointers to hwmon_channel_info
commit: 303b1e894470421f7c5b6452937fc8c1f0f89075
[4/4] rtc: rv3032: constify pointers to hwmon_channel_info
commit: b19118965778da3ba9fbeeca39bdf24738d229b4

Best regards,

--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com