From: Christian Hohnstaedt <chohnstaedt@innominate.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors]
Date: Tue, 24 Jul 2007 13:43:28 +0000 [thread overview]
Message-ID: <20070724134328.GD18984@tweety> (raw)
In-Reply-To: <87ekb9s3tn.wl%info@wore.ma.cx>
On Tue, Jul 24, 2007 at 03:09:57PM +0200, Jean Delvare wrote:
> On Tue, 24 Jul 2007 14:57:53 +0200, Christian Hohnstaedt wrote:
> > On Tue, Jul 24, 2007 at 02:06:04PM +0200, Jean Delvare wrote:
> > > On Tue, 24 Jul 2007 11:35:37 +0200, Christian Hohnstaedt wrote:
> > > > diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
> > > > index a40166f..4fa3220 100644
> > > > --- a/drivers/hwmon/lm75.c
> > > > +++ b/drivers/hwmon/lm75.c
> > > > @@ -95,7 +95,7 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *da,
> > > > struct i2c_client *client = to_i2c_client(dev);
> > > > struct lm75_data *data = i2c_get_clientdata(client);
> > > > int nr = attr->index;
> > > > - unsigned long temp = simple_strtoul(buf, NULL, 10);
> > > > + int temp = simple_strtol(buf, NULL, 10);
> > > >
> > > > mutex_lock(&data->update_lock);
> > > > data->temp[nr] = LM75_TEMP_TO_REG(temp);
> > >
> > > temp should be a long rather than an int. Otherwise the input value
> > > might wrap before LM75_TEMP_TO_REG has a chance to clamp it.
> >
> > Since LM75_TEMP_TO_REG() expects an int, I thought it would be best
> > to make temp an int here, to reduce confusion.
>
> Good point. But what this means then is that LM75_TEMP_TO_REG() should
> take a long as a parameter rather than an int.
Sounds reasonable.
Then LM75_TEMP_FROM_REG() should also return a long instead of an int.
Other drivers using LM75_TEMP_TO_REG:
driver temp.type func
------------------------------------
asb100.c long strtoul
ds1621.c direct strtoul
w83627e?hf.c u32 strtoul
w83781d.c s32 strtol
Looks like there is some kind of general inconsistency :-)
Christian Hohnstaedt
--
Christian Hohnstaedt
Software Engineer
Innominate Security Technologies AG /protecting industrial networks/
tel: +49.30.6392-3285 fax: +49.30.6392-3307
Albert-Einstein-Strasse 14, D-12489 Berlin, Germany
http://www.innominate.com
Register Court: AG Charlottenburg, HR B 81603
Management Board: Joachim Fietz, Dirk Seewald
Chairman of the Supervisory Board: Edward M. Stadum
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2007-07-24 13:43 UTC|newest]
Thread overview: 84+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-11 10:20 [lm-sensors] wore
2005-10-26 22:17 ` [lm-sensors] Mauro Carvalho Chehab
2005-10-26 22:40 ` [lm-sensors] Greg KH
2005-10-26 22:46 ` [lm-sensors] Jean Delvare
2005-10-27 14:03 ` [lm-sensors] Mauro Carvalho Chehab
2005-10-27 16:53 ` [lm-sensors] Mauro Carvalho Chehab
2005-10-27 23:07 ` [lm-sensors] Jean Delvare
2005-10-27 23:43 ` [lm-sensors] Jean Delvare
2006-05-05 19:34 ` [lm-sensors] Dieter Jurzitza
2006-05-05 20:53 ` [lm-sensors] Dieter Jurzitza
2006-05-30 8:53 ` [lm-sensors] Laurent Pinchart
2006-12-03 8:22 ` [lm-sensors] Udo van den Heuvel
2006-12-03 8:38 ` [lm-sensors] Thomas Dohl
2006-12-03 8:49 ` [lm-sensors] Udo van den Heuvel
2006-12-03 20:20 ` [lm-sensors] Thomas Dohl
2007-01-08 7:39 ` [lm-sensors] Christophe de Rivière
2007-04-15 7:48 ` [lm-sensors] jk
2007-05-10 17:36 ` [lm-sensors] Dieter Rogiest
2007-05-10 18:02 ` [lm-sensors] Hans-Jürgen Koch
2007-05-10 18:46 ` [lm-sensors] Stephen Cormier
2007-05-10 19:31 ` [lm-sensors] Rudolf Marek
2007-05-10 20:34 ` [lm-sensors] Dieter Rogiest
2007-05-10 22:28 ` [lm-sensors] Rudolf Marek
2007-05-10 22:40 ` [lm-sensors] Dieter Rogiest
2007-07-24 12:06 ` [lm-sensors] Jean Delvare
2007-07-24 12:57 ` [lm-sensors] Christian Hohnstaedt
2007-07-24 13:09 ` [lm-sensors] Jean Delvare
2007-07-24 13:43 ` Christian Hohnstaedt [this message]
2007-08-12 11:13 ` [lm-sensors] Jean Delvare
2007-08-13 8:39 ` [lm-sensors] Christian Hohnstaedt
2007-08-13 12:29 ` [lm-sensors] Jean Delvare
2007-08-15 15:32 ` [lm-sensors] Christian Hohnstaedt
2007-08-15 19:28 ` [lm-sensors] Jean Delvare
2007-08-16 8:08 ` [lm-sensors] Christian Hohnstaedt
2007-10-07 18:38 ` [lm-sensors] Hans de Goede
2007-10-07 19:33 ` [lm-sensors] Mark M. Hoffman
2007-10-31 15:29 ` [lm-sensors] Hans de Goede
2008-06-01 10:15 ` [lm-sensors] Dominik Geyer
2008-09-17 13:50 ` [lm-sensors] Frank Myhr
2010-03-09 22:50 ` [lm-sensors] Phillip Pi
2010-10-31 7:42 ` [lm-sensors] Zamzit
2011-01-20 20:04 ` [lm-sensors] Guenter Roeck
2011-01-24 21:20 ` [lm-sensors] Yu, Fenghua
2011-03-28 18:11 ` [lm-sensors] R, Durgadoss
2011-04-05 17:47 ` [lm-sensors] Guenter Roeck
2011-04-06 6:54 ` [lm-sensors] R, Durgadoss
2011-04-06 7:18 ` [lm-sensors] Guenter Roeck
2011-06-21 9:44 ` [lm-sensors] Jay Alexander Fleming
2011-06-23 21:30 ` [lm-sensors] Valentijn Scholten
2011-06-24 22:01 ` [lm-sensors] Valentijn Scholten
2011-06-25 18:44 ` [lm-sensors] Valentijn Scholten
2011-10-01 13:38 ` [lm-sensors] Maryvonne JUDIT
2011-10-23 14:53 ` [lm-sensors] Malika et Christophe CHARBONNIER
2011-12-22 9:33 ` [lm-sensors] serge chartrain
-- strict thread matches above, loose matches on Subject: below --
2007-04-10 13:02 [lm-sensors] Hardware monitoring subsystem maintainer position is Jean Delvare
2007-04-12 5:57 ` [lm-sensors] Hardware monitoring subsystem maintainer Krzysztof Helt
2007-04-12 7:27 ` [lm-sensors] Hardware monitoring subsystem Hans de Goede
2007-04-15 2:07 ` [lm-sensors] Dmitry Torokhov
2008-09-18 8:12 [lm-sensors] + Sebastian Siewior
2008-09-18 8:15 ` Sebastian Siewior
2008-09-18 8:25 ` Andrew Morton
2008-09-18 9:08 ` Sebastian Siewior
2008-09-18 20:02 ` Jean Delvare
2008-09-18 21:13 ` Andrew Morton
2008-09-19 13:13 ` Jean Delvare
2009-06-12 15:25 [lm-sensors] =?UTF-8?Q?Re: [PATCH] hwmon: Add driver for VIA CPU tomaz.mertelj
2009-06-12 15:31 ` [lm-sensors] " Michael S. Zick
2009-06-12 16:04 ` Michael S. Zick
2009-06-12 17:38 ` [lm-sensors] Michael S. Zick
2009-06-12 18:16 [lm-sensors] =?UTF-8?Q?Re: [PATCH] hwmon: Add driver for VIA CPU tomaz.mertelj
2009-06-12 18:20 ` [lm-sensors] Michael S. Zick
2009-11-14 9:09 [lm-sensors] + Jean Delvare
2010-12-20 6:06 Patch[1/2]X86:Adding_Notification_Support_to_therm_throt.c R, Durgadoss
2010-12-20 6:18 ` [lm-sensors] R, Durgadoss
2010-12-28 10:25 Patch[1/2]X86:Adding_Notification_Support_to_therm_throt.c R, Durgadoss
2010-12-28 10:37 ` [lm-sensors] R, Durgadoss
2010-12-28 10:38 [lm-sensors] Patch[2/2]:hwmon:Adding_Threshold_Support_to_Coretemp.c R, Durgadoss
2011-01-04 19:40 ` [lm-sensors] Guenter Roeck
2011-01-03 11:52 Patch[1/2]X86:Adding_Notification_Support_to_therm_throt.c R, Durgadoss
2011-01-03 11:54 ` [lm-sensors] R, Durgadoss
2011-01-03 15:03 ` [lm-sensors] Guenter Roeck
2011-01-03 15:03 ` Patch[1/2]X86:Adding_Notification_Support_to_therm_throt.c Guenter Roeck
2011-01-03 15:11 ` Patch[1/2]X86:Adding_Notification_Support_to_therm_throt.c R, Durgadoss
2011-01-03 15:23 ` [lm-sensors] R, Durgadoss
2011-01-03 15:38 ` [lm-sensors] Guenter Roeck
2011-01-03 15:38 ` Patch[1/2]X86:Adding_Notification_Support_to_therm_throt.c Guenter Roeck
2011-01-04 8:56 ` Patch[1/2]X86:Adding_Notification_Support_to_therm_throt.c R, Durgadoss
2011-01-04 9:08 ` [lm-sensors] R, Durgadoss
2011-01-04 8:20 ` [tip:x86/hwmon] x86, hwmon: Add core threshold notification to therm_throt.c tip-bot for R, Durgadoss
2011-01-04 8:29 ` R, Durgadoss
2011-01-20 7:57 [lm-sensors] patch[1/1]:hwmon:Adding_Threshold_support_to_coretemp R, Durgadoss
2011-01-20 22:17 ` [lm-sensors] Fenghua Yu
2011-01-21 2:26 ` [lm-sensors] Guenter Roeck
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=20070724134328.GD18984@tweety \
--to=chohnstaedt@innominate.com \
--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.