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/lm73.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/hwmon/lm73.c') diff --git a/drivers/hwmon/lm73.c b/drivers/hwmon/lm73.c index 7272176a9ec7..5166a8e3a061 100644 --- a/drivers/hwmon/lm73.c +++ b/drivers/hwmon/lm73.c @@ -56,8 +56,8 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *da, return status; /* Write value */ - value = (short) SENSORS_LIMIT(temp/250, (LM73_TEMP_MIN*4), - (LM73_TEMP_MAX*4)) << 5; + value = (short) clamp_val(temp / 250, LM73_TEMP_MIN * 4, + LM73_TEMP_MAX * 4) << 5; err = i2c_smbus_write_word_swapped(client, attr->index, value); return (err < 0) ? err : count; } -- cgit v1.2.3