提交 088341bd 编写于 作者: J Jean Delvare 提交者: Greg Kroah-Hartman

[PATCH] hwmon: via686a: save 0.5k by long v[256] -> s16 v[256]

We can save 0.5kB of data in the via686a driver.

From: Denis Vlasenko <vda@ilport.com.ua>
Signed-off-by: NJean Delvare <khali@linux-fr.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 c7461a66
...@@ -198,7 +198,7 @@ static inline u8 FAN_TO_REG(long rpm, int div) ...@@ -198,7 +198,7 @@ static inline u8 FAN_TO_REG(long rpm, int div)
but the function is very linear in the useful range (0-80 deg C), so but the function is very linear in the useful range (0-80 deg C), so
we'll just use linear interpolation for 10-bit readings.) So, tempLUT we'll just use linear interpolation for 10-bit readings.) So, tempLUT
is the temp at via register values 0-255: */ is the temp at via register values 0-255: */
static const long tempLUT[] = static const s16 tempLUT[] =
{ -709, -688, -667, -646, -627, -607, -589, -570, -553, -536, -519, { -709, -688, -667, -646, -627, -607, -589, -570, -553, -536, -519,
-503, -487, -471, -456, -442, -428, -414, -400, -387, -375, -503, -487, -471, -456, -442, -428, -414, -400, -387, -375,
-362, -350, -339, -327, -316, -305, -295, -285, -275, -265, -362, -350, -339, -327, -316, -305, -295, -285, -275, -265,
...@@ -270,7 +270,7 @@ static inline u8 TEMP_TO_REG(long val) ...@@ -270,7 +270,7 @@ static inline u8 TEMP_TO_REG(long val)
} }
/* for 8-bit temperature hyst and over registers */ /* for 8-bit temperature hyst and over registers */
#define TEMP_FROM_REG(val) (tempLUT[(val)] * 100) #define TEMP_FROM_REG(val) ((long)tempLUT[val] * 100)
/* for 10-bit temperature readings */ /* for 10-bit temperature readings */
static inline long TEMP_FROM_REG10(u16 val) static inline long TEMP_FROM_REG10(u16 val)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册