Skip to contentSkip to conversation

ACPI: CELSIUS_TO_KELVIN fixup

PATCH In review Zhang Rui 1 participant 1 message Jan 17, 2008

Subsystems (3)
lore
Share & tools
lore

Zhang Rui

author reviewer
#0 lore raw

PATCH 8/10 ACPI: CELSIUS_TO_KELVIN fixup

From: Zhang Rui <[email protected]>

Fix an imprecision in CELSIUS_TO_KELVIN and move these two macroes to a proper place.

---
 drivers/acpi/thermal.c  |    3 ---
 include/linux/thermal.h |    4 ++++
 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/acpi/thermal.c +0 -3
Index: linux-2.6/drivers/acpi/thermal.c
===================================================================
@@ -65,9 +65,6 @@
 #define ACPI_THERMAL_MAX_ACTIVE	10
 #define ACPI_THERMAL_MAX_LIMIT_STR_LEN 65
 
-#define KELVIN_TO_CELSIUS(t)    (long)(((long)t-2732>=0) ? ((long)t-2732+5)/10 : ((long)t-2732-5)/10)
-#define CELSIUS_TO_KELVIN(t)	((t+273)*10)
-
 #define _COMPONENT		ACPI_THERMAL_COMPONENT
 ACPI_MODULE_NAME("thermal");
 
include/linux/thermal.h +4 -0
Index: linux-2.6/include/linux/thermal.h
===================================================================
@@ -61,6 +61,10 @@ struct thermal_cooling_device {
 	struct list_head node;
 };
 
+#define KELVIN_TO_CELSIUS(t)	(long)(((long)t-2732 >= 0) ?	\
+				((long)t-2732+5)/10 : ((long)t-2732-5)/10)
+#define CELSIUS_TO_KELVIN(t)	((t)*10+2732)
+
 struct thermal_zone_device {
 	int id;
 	char type[THERMAL_NAME_LENGTH];