From: Alexey Starikovskiy <aystarik@gmail.com>
To: "Zhang, Rui" <rui.zhang@intel.com>
Cc: linux-acpi <linux-acpi@vger.kernel.org>,
lm-sensors <lm-sensors@lm-sensors.org>,
Len Brown <lenb@kernel.org>
Subject: Re: [PATCH 2/2] ACPI: show temperature in millidegree Celsius
Date: Wed, 27 Feb 2008 13:13:53 +0300 [thread overview]
Message-ID: <47C537E1.5090103@gmail.com> (raw)
In-Reply-To: <1204072678.10256.112.camel@acpi-hp-zz.sh.intel.com>
Rui,
As I remember, ACPI returns temperature in 10ths of degree. If you are
going to report it in 1000ths of degree,
there is no reason to round them to degree.
Regards,
Alex.
Zhang, Rui wrote:
> Show the temperature in Millidegree Celsius.
>
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> ---
> drivers/acpi/thermal.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> Index: linux-2.6/drivers/acpi/thermal.c
> ===================================================================
> --- linux-2.6.orig/drivers/acpi/thermal.c
> +++ linux-2.6/drivers/acpi/thermal.c
> @@ -879,6 +879,8 @@ static void acpi_thermal_check(void *dat
> }
>
> /* sys I/F for generic thermal sysfs support */
> +#define KELVIN_TO_MILLICELSIUS(t) (KELVIN_TO_CELSIUS(t) * 1000)
> +
> static int thermal_get_temp(struct thermal_zone_device *thermal, char *buf)
> {
> struct acpi_thermal *tz = thermal->devdata;
> @@ -886,7 +888,7 @@ static int thermal_get_temp(struct therm
> if (!tz)
> return -EINVAL;
>
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(tz->temperature));
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(tz->temperature));
> }
>
> static const char enabled[] = "kernel";
> @@ -980,21 +982,21 @@ static int thermal_get_trip_temp(struct
>
> if (tz->trips.critical.flags.valid) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.critical.temperature));
> trip--;
> }
>
> if (tz->trips.hot.flags.valid) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.hot.temperature));
> trip--;
> }
>
> if (tz->trips.passive.flags.valid) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.passive.temperature));
> trip--;
> }
> @@ -1002,7 +1004,7 @@ static int thermal_get_trip_temp(struct
> for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE &&
> tz->trips.active[i].flags.valid; i++) {
> if (!trip)
> - return sprintf(buf, "%ld\n", KELVIN_TO_CELSIUS(
> + return sprintf(buf, "%ld\n", KELVIN_TO_MILLICELSIUS(
> tz->trips.active[i].temperature));
> trip--;
> }
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2008-02-27 10:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-27 0:37 [PATCH 2/2] ACPI: show temperature in millidegree Celsius Zhang, Rui
2008-02-27 10:13 ` Alexey Starikovskiy [this message]
2008-02-27 23:51 ` Zhang, Rui
2008-02-28 21:00 ` Jean Delvare
2008-03-12 4:28 ` Len Brown
-- strict thread matches above, loose matches on Subject: below --
2008-02-25 21:31 Zhang, Rui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47C537E1.5090103@gmail.com \
--to=aystarik@gmail.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=lm-sensors@lm-sensors.org \
--cc=rui.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox