Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3204ed3 authored by Jan Beulich's avatar Jan Beulich Committed by Guenter Roeck
Browse files

hwmon: (coretemp) constify static data



These arrays won't ever be written to, so protect them from
unintentional modification.

Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
Signed-off-by: default avatarGuenter Roeck <guenter.roeck@ericsson.com>
parent b3a242a6
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -347,11 +347,11 @@ static int create_core_attrs(struct temp_data *tdata, struct device *dev,
				int attr_no)
				int attr_no)
{
{
	int err, i;
	int err, i;
	static ssize_t (*rd_ptr[TOTAL_ATTRS]) (struct device *dev,
	static ssize_t (*const rd_ptr[TOTAL_ATTRS]) (struct device *dev,
			struct device_attribute *devattr, char *buf) = {
			struct device_attribute *devattr, char *buf) = {
			show_label, show_crit_alarm, show_temp, show_tjmax,
			show_label, show_crit_alarm, show_temp, show_tjmax,
			show_ttarget };
			show_ttarget };
	static const char *names[TOTAL_ATTRS] = {
	static const char *const names[TOTAL_ATTRS] = {
					"temp%d_label", "temp%d_crit_alarm",
					"temp%d_label", "temp%d_crit_alarm",
					"temp%d_input", "temp%d_crit",
					"temp%d_input", "temp%d_crit",
					"temp%d_max" };
					"temp%d_max" };