linux/thermal.h: rename KELVIN_TO_CELSIUS to DECI_KELVIN_TO_CELSIUS
The macros KELVIN_TO_CELSIUS and CELSIUS_TO_KELVIN actually convert between deciKelvins and Celsius, so rename them to reflect that. While at it, use a statement expression in DECI_KELVIN_TO_CELSIUS to prevent expanding the argument multiple times and get rid of a few casts. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Acked-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
This commit is contained in:
committed by
Zhang Rui
parent
a71544cd93
commit
e866a2e395
@@ -315,7 +315,7 @@ static ssize_t aux0_show(struct device *dev,
|
||||
|
||||
result = sensor_get_auxtrip(attr->handle, 0, &value);
|
||||
|
||||
return result ? result : sprintf(buf, "%lu", KELVIN_TO_CELSIUS(value));
|
||||
return result ? result : sprintf(buf, "%lu", DECI_KELVIN_TO_CELSIUS(value));
|
||||
}
|
||||
|
||||
static ssize_t aux1_show(struct device *dev,
|
||||
@@ -327,7 +327,7 @@ static ssize_t aux1_show(struct device *dev,
|
||||
|
||||
result = sensor_get_auxtrip(attr->handle, 1, &value);
|
||||
|
||||
return result ? result : sprintf(buf, "%lu", KELVIN_TO_CELSIUS(value));
|
||||
return result ? result : sprintf(buf, "%lu", DECI_KELVIN_TO_CELSIUS(value));
|
||||
}
|
||||
|
||||
static ssize_t aux0_store(struct device *dev,
|
||||
@@ -345,7 +345,7 @@ static ssize_t aux0_store(struct device *dev,
|
||||
if (value < 0)
|
||||
return -EINVAL;
|
||||
|
||||
result = sensor_set_auxtrip(attr->handle, 0, CELSIUS_TO_KELVIN(value));
|
||||
result = sensor_set_auxtrip(attr->handle, 0, CELSIUS_TO_DECI_KELVIN(value));
|
||||
return result ? result : count;
|
||||
}
|
||||
|
||||
@@ -364,7 +364,7 @@ static ssize_t aux1_store(struct device *dev,
|
||||
if (value < 0)
|
||||
return -EINVAL;
|
||||
|
||||
result = sensor_set_auxtrip(attr->handle, 1, CELSIUS_TO_KELVIN(value));
|
||||
result = sensor_set_auxtrip(attr->handle, 1, CELSIUS_TO_DECI_KELVIN(value));
|
||||
return result ? result : count;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user