Skip to content

Commit da9373d

Browse files
committed
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal
Pull thermal fixes from Eduardo Valentin: "A couple of minor fixes for the thermal subsystem. Specifics in this pull request: - Fixes in hisilicon thermal driver - More fixes of unsigned to int type change in thermal_core.c" * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal: thermal: use %d to print S32 parameters thermal: hisilicon: increase temperature resolution
2 parents 1b46bac + 15333e3 commit da9373d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/thermal/hisi_thermal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ static inline int _step_to_temp(int step)
6868
* Every step equals (1 * 200) / 255 celsius, and finally
6969
* need convert to millicelsius.
7070
*/
71-
return (HISI_TEMP_BASE + (step * 200 / 255)) * 1000;
71+
return (HISI_TEMP_BASE * 1000 + (step * 200000 / 255));
7272
}
7373

7474
static inline long _temp_to_step(long temp)
7575
{
76-
return ((temp / 1000 - HISI_TEMP_BASE) * 255 / 200);
76+
return ((temp - HISI_TEMP_BASE * 1000) * 255) / 200000;
7777
}
7878

7979
static long hisi_thermal_get_sensor_temp(struct hisi_thermal_data *data,

drivers/thermal/thermal_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ static DEVICE_ATTR(sustainable_power, S_IWUSR | S_IRUGO, sustainable_power_show,
959959
struct thermal_zone_device *tz = to_thermal_zone(dev); \
960960
\
961961
if (tz->tzp) \
962-
return sprintf(buf, "%u\n", tz->tzp->name); \
962+
return sprintf(buf, "%d\n", tz->tzp->name); \
963963
else \
964964
return -EIO; \
965965
} \

0 commit comments

Comments
 (0)