]> git.hungrycats.org Git - linux/commit
[PATCH] I2C: Store lm83 and lm90 temperatures in signed
authorJean Delvare <khali@linux-fr.org>
Wed, 29 Sep 2004 06:29:06 +0000 (23:29 -0700)
committerGreg Kroah-Hartman <greg@press.kroah.org>
Wed, 29 Sep 2004 06:29:06 +0000 (23:29 -0700)
commiteb20210c1b0665667887e8586af3a8e0345fb4b2
tree2d2a23648dac5a37dcef2c6ba7d8d18c3a42534a
parentc601391b19e77a5158873a5607ee8069b2035ac4
[PATCH] I2C: Store lm83 and lm90 temperatures in signed

Back when I wrote the lm83 and lm90 drivers, I decided to use unsigned
variables to store temperature values as mirrored from the chipset
registers. I wonder why, since the registers use signed values
themselves. The patch below changes the variables back to signed types,
so as to simplify the conversions made by the driver, making them faster
and easier to understand.

Additionally, the lm90 driver was lacking boundary checkings and proper
rounding when writing temperature limits to the chipset, so I added
these. I also reworded the comments about internal temperature values
representation for all chipsets.

Tested to work fine on my (LM90-compatible) ADM1032 chip. lm83 patch
untested, but it is more simple and directly copied from the lm90, so I
am confident it works fine too.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/i2c/chips/lm83.c
drivers/i2c/chips/lm90.c