From: gregkh@suse.de (Greg KH)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [PATCH] hwmon: Fix negative temperature readings in
Date: Mon, 06 Feb 2006 20:18:57 +0000 [thread overview]
Message-ID: <11392571371598@kroah.com> (raw)
[PATCH] hwmon: Fix negative temperature readings in lm77 driver
Fix negative temperature readings in lm77 driver.
Signed-off-by: Jean Delvare <khali at linux-fr.org>
Acked-by: Michael Renzmann <mrenzmann at otaku42.de>
Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
---
commit 413b64515079a4063776d81067f69cc41bdb34ad
tree 1353d1b285b84963ad48abac3327a397cbc818d2
parent 21bbd691827e3610ef975a88863859381ac8d8e0
author Jean Delvare <khali at linux-fr.org> Mon, 09 Jan 2006 22:43:08 +0100
committer Greg Kroah-Hartman <gregkh at suse.de> Mon, 06 Feb 2006 12:02:14 -0800
drivers/hwmon/lm77.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/hwmon/lm77.c b/drivers/hwmon/lm77.c
index a2f420d..df9e02a 100644
--- a/drivers/hwmon/lm77.c
+++ b/drivers/hwmon/lm77.c
@@ -87,15 +87,15 @@ static struct i2c_driver lm77_driver = {
/* In the temperature registers, the low 3 bits are not part of the
temperature values; they are the status bits. */
-static inline u16 LM77_TEMP_TO_REG(int temp)
+static inline s16 LM77_TEMP_TO_REG(int temp)
{
int ntemp = SENSORS_LIMIT(temp, LM77_TEMP_MIN, LM77_TEMP_MAX);
- return (u16)((ntemp / 500) * 8);
+ return (ntemp / 500) * 8;
}
-static inline int LM77_TEMP_FROM_REG(u16 reg)
+static inline int LM77_TEMP_FROM_REG(s16 reg)
{
- return ((int)reg / 8) * 500;
+ return (reg / 8) * 500;
}
/* sysfs stuff */
reply other threads:[~2006-02-06 20:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=11392571371598@kroah.com \
--to=gregkh@suse.de \
--cc=lm-sensors@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.