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/smsc47m192.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/hwmon/smsc47m192.c') diff --git a/drivers/hwmon/smsc47m192.c b/drivers/hwmon/smsc47m192.c index 36a3478d0799..efee4c59239f 100644 --- a/drivers/hwmon/smsc47m192.c +++ b/drivers/hwmon/smsc47m192.c @@ -77,7 +77,7 @@ static inline unsigned int IN_FROM_REG(u8 reg, int n) static inline u8 IN_TO_REG(unsigned long val, int n) { - return SENSORS_LIMIT(SCALE(val, 192, nom_mv[n]), 0, 255); + return clamp_val(SCALE(val, 192, nom_mv[n]), 0, 255); } /* @@ -86,7 +86,7 @@ static inline u8 IN_TO_REG(unsigned long val, int n) */ static inline s8 TEMP_TO_REG(int val) { - return SENSORS_LIMIT(SCALE(val, 1, 1000), -128000, 127000); + return clamp_val(SCALE(val, 1, 1000), -128000, 127000); } static inline int TEMP_FROM_REG(s8 val) -- cgit v1.2.3