hwmon: sht4x: constify pointers to hwmon_channel_info
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Thu, 6 Apr 2023 20:38:18 +0000 (22:38 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 19 Apr 2023 14:08:38 +0000 (07:08 -0700)
Statically allocated array of pointed to hwmon_channel_info can be made
const for safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/sht4x.c

index 13e0429..5bbe091 100644 (file)
@@ -214,7 +214,7 @@ static int sht4x_hwmon_write(struct device *dev, enum hwmon_sensor_types type,
        }
 }
 
-static const struct hwmon_channel_info *sht4x_info[] = {
+static const struct hwmon_channel_info * const sht4x_info[] = {
        HWMON_CHANNEL_INFO(chip, HWMON_C_UPDATE_INTERVAL),
        HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT),
        HWMON_CHANNEL_INFO(humidity, HWMON_H_INPUT),