diff mbox series

[12/68] hwmon: corsair: constify pointers to hwmon_channel_info

Message ID 20230406203103.3011503-13-krzysztof.kozlowski@linaro.org (mailing list archive)
State New, archived
Headers show
Series hwmon: constify pointers to hwmon_channel_info | expand

Commit Message

Krzysztof Kozlowski April 6, 2023, 8:30 p.m. UTC
Statically allocated array of pointed to hwmon_channel_info can be made
const for safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/hwmon/corsair-cpro.c | 2 +-
 drivers/hwmon/corsair-psu.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Wilken Gottwalt April 9, 2023, 8:21 a.m. UTC | #1
On Thu,  6 Apr 2023 22:30:07 +0200
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:

> diff --git a/drivers/hwmon/corsair-psu.c b/drivers/hwmon/corsair-psu.c
> index 2210aa62e3d0..dc24c566d08b 100644
> --- a/drivers/hwmon/corsair-psu.c
> +++ b/drivers/hwmon/corsair-psu.c
> @@ -571,7 +571,7 @@ static const struct hwmon_ops corsairpsu_hwmon_ops = {
>  	.read_string	= corsairpsu_hwmon_ops_read_string,
>  };
>  
> -static const struct hwmon_channel_info *corsairpsu_info[] = {
> +static const struct hwmon_channel_info * const corsairpsu_info[] = {
>  	HWMON_CHANNEL_INFO(chip,
>  			   HWMON_C_REGISTER_TZ),
>  	HWMON_CHANNEL_INFO(temp,

Wait a minute. Can you at least match it to the coding style of the driver?
A lot of work went into it to keep it consistent.

greetings,
Will
diff mbox series

Patch

diff --git a/drivers/hwmon/corsair-cpro.c b/drivers/hwmon/corsair-cpro.c
index fa6aa4fc8b52..463ab4296ede 100644
--- a/drivers/hwmon/corsair-cpro.c
+++ b/drivers/hwmon/corsair-cpro.c
@@ -385,7 +385,7 @@  static const struct hwmon_ops ccp_hwmon_ops = {
 	.write = ccp_write,
 };
 
-static const struct hwmon_channel_info *ccp_info[] = {
+static const struct hwmon_channel_info * const ccp_info[] = {
 	HWMON_CHANNEL_INFO(chip,
 			   HWMON_C_REGISTER_TZ),
 	HWMON_CHANNEL_INFO(temp,
diff --git a/drivers/hwmon/corsair-psu.c b/drivers/hwmon/corsair-psu.c
index 2210aa62e3d0..dc24c566d08b 100644
--- a/drivers/hwmon/corsair-psu.c
+++ b/drivers/hwmon/corsair-psu.c
@@ -571,7 +571,7 @@  static const struct hwmon_ops corsairpsu_hwmon_ops = {
 	.read_string	= corsairpsu_hwmon_ops_read_string,
 };
 
-static const struct hwmon_channel_info *corsairpsu_info[] = {
+static const struct hwmon_channel_info * const corsairpsu_info[] = {
 	HWMON_CHANNEL_INFO(chip,
 			   HWMON_C_REGISTER_TZ),
 	HWMON_CHANNEL_INFO(temp,