From 2a844c148e1f714ebf42cb96e1b172ce394c36c9 Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Wed, 9 Jan 2013 08:09:34 -0800 Subject: hwmon: Replace SENSORS_LIMIT with clamp_val SENSORS_LIMIT and the generic clamp_val have the same functionality, and clamp_val is more efficient. This patch reduces text size by 9052 bytes and bss size by 11624 bytes for x86_64 builds. Signed-off-by: Guenter Roeck Acked-by: George Joseph Acked-by: Jean Delvare --- drivers/hwmon/sis5595.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/hwmon/sis5595.c') diff --git a/drivers/hwmon/sis5595.c b/drivers/hwmon/sis5595.c index 06ce3c911db9..c35847a1a0a3 100644 --- a/drivers/hwmon/sis5595.c +++ b/drivers/hwmon/sis5595.c @@ -132,7 +132,7 @@ static struct platform_device *pdev; */ static inline u8 IN_TO_REG(unsigned long val) { - unsigned long nval = SENSORS_LIMIT(val, 0, 4080); + unsigned long nval = clamp_val(val, 0, 4080); return (nval + 8) / 16; } #define IN_FROM_REG(val) ((val) * 16) @@ -141,7 +141,7 @@ static inline u8 FAN_TO_REG(long rpm, int div) { if (rpm <= 0) return 255; - return SENSORS_LIMIT((1350000 + rpm * div / 2) / (rpm * div), 1, 254); + return clamp_val((1350000 + rpm * div / 2) / (rpm * div), 1, 254); } static inline int FAN_FROM_REG(u8 val, int div) @@ -159,7 +159,7 @@ static inline int TEMP_FROM_REG(s8 val) } static inline s8 TEMP_TO_REG(int val) { - int nval = SENSORS_LIMIT(val, -54120, 157530) ; + int nval = clamp_val(val, -54120, 157530) ; return nval < 0 ? (nval - 5212 - 415) / 830 : (nval - 5212 + 415) / 830; } -- cgit v1.2.3