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

Commit acf32964 authored by Michael Neuling's avatar Michael Neuling Committed by Guenter Roeck
Browse files

hwmon: (ibmpowernv) Fix label for cores numbers not threads



Currently the label says "Core" but lists the thread numbers. This
ends up looking like this:
    # cat /sys/class/hwmon/hwmon0/temp[1-4]_label
    Core 0-7
    Core 8-15
    Core 16-23
    Core 24-31

This is misleading as it looks like it's cores 0-7 when it's actually
threads 0-7.

This changes the print to just give the core number, so the output now
looks like this:
    # cat /sys/class/hwmon/hwmon0/temp[1-4]_label
    Core 0
    Core 8
    Core 16
    Core 24

Signed-off-by: default avatarMichael Neuling <mikey@neuling.org>
Acked-by: default avatarCédric Le Goater <clg@kaod.org>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 93cacfd4
Loading
Loading
Loading
Loading
+3 −5
Original line number Original line Diff line number Diff line
@@ -143,13 +143,11 @@ static void __init make_sensor_label(struct device_node *np,
		if (cpuid >= 0)
		if (cpuid >= 0)
			/*
			/*
			 * The digital thermal sensors are associated
			 * The digital thermal sensors are associated
			 * with a core. Let's print out the range of
			 * with a core.
			 * cpu ids corresponding to the hardware
			 * threads of the core.
			 */
			 */
			n += snprintf(sdata->label + n,
			n += snprintf(sdata->label + n,
				      sizeof(sdata->label) - n, " %d-%d",
				      sizeof(sdata->label) - n, " %d",
				      cpuid, cpuid + threads_per_core - 1);
				      cpuid);
		else
		else
			n += snprintf(sdata->label + n,
			n += snprintf(sdata->label + n,
				      sizeof(sdata->label) - n, " phy%d", id);
				      sizeof(sdata->label) - n, " phy%d", id);