From: Zhang Rui Date: Thu, 17 Jan 2008 07:51:19 +0000 (+0800) Subject: ACPI: CELSIUS_TO_KELVIN fixup X-Git-Tag: v2.6.25-rc1~297^2~3^2~2^2~1^3~3 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=041d4bbf128f645fe53bb22309efb9db14dbf5b5;p=linux-2.6 ACPI: CELSIUS_TO_KELVIN fixup Fix an imprecision in CELSIUS_TO_KELVIN and move these two macroes to a proper place. Signed-off-by: Zhang Rui Signed-off-by: Thomas Sujith Signed-off-by: Len Brown --- diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 7400363557..aee371f9da 100644 --- a/drivers/acpi/thermal.c +++ b/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"); diff --git a/include/linux/thermal.h b/include/linux/thermal.h index e4b76c7afb..bba7712cad 100644 --- a/include/linux/thermal.h +++ b/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];