Skip to content

Commit

Permalink
[PATCH] hwmon: Minor w83l785ts optimization
Browse files Browse the repository at this point in the history
Using s8 instead of u8 to store temperature register values saves a
few instructions on sysfs file read. The very same was done for
several other drivers a while ago (lm63, lm83, lm90...)

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

 drivers/hwmon/w83l785ts.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  • Loading branch information
Jean Delvare authored and Greg Kroah-Hartman committed Oct 28, 2005
1 parent 709439a commit cb929ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/hwmon/w83l785ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ I2C_CLIENT_INSMOD_1(w83l785ts);
* The W83L785TS-S uses signed 8-bit values.
*/

#define TEMP_FROM_REG(val) ((val & 0x80 ? val-0x100 : val) * 1000)
#define TEMP_FROM_REG(val) ((val) * 1000)

/*
* Functions declaration
Expand Down Expand Up @@ -112,7 +112,7 @@ struct w83l785ts_data {
unsigned long last_updated; /* in jiffies */

/* registers values */
u8 temp[2]; /* 0: input
s8 temp[2]; /* 0: input
1: critical limit */
};

Expand Down

0 comments on commit cb929ea

Please sign in to comment.