hwmon: put HWMON_CHANNEL_INFO() initializers in rodata
authorJani Nikula <jani.nikula@intel.com>
Wed, 17 Jan 2024 11:44:05 +0000 (13:44 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 11 Feb 2024 21:43:08 +0000 (13:43 -0800)
commitb9f55084aa0962af6247fa971f0b1e9c7aa676ef
tree169bc7eecbceda34a87ab963848d55a5c7d97bf7
parent841c35169323cd833294798e58b9bf63fa4fa1de
hwmon: put HWMON_CHANNEL_INFO() initializers in rodata

HWMON_CHANNEL_INFO() is supposed to be used as initializer for arrays of
const struct hwmon_channel_info *. However, without explicit const,
HWMON_CHANNEL_INFO() creates mutable compound literals, and the const
pointers point at the mutable data. Add const to place the data in
rodata.

Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/20240117114405.1506775-1-jani.nikula@intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
include/linux/hwmon.h