From: Jean Delvare Date: Sun, 25 Sep 2005 14:45:03 +0000 (+0200) Subject: [PATCH] hwmon: Minor w83l785ts optimization X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cb929eae78ec0b243dbf58039bce4af354f6020c;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [PATCH] hwmon: Minor w83l785ts optimization 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 Signed-off-by: Greg Kroah-Hartman drivers/hwmon/w83l785ts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- diff --git a/drivers/hwmon/w83l785ts.c b/drivers/hwmon/w83l785ts.c index fcb2c39b04fd..db12a620b331 100644 --- a/drivers/hwmon/w83l785ts.c +++ b/drivers/hwmon/w83l785ts.c @@ -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 @@ -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 */ };