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 <linux@roeck-us.net> Acked-by: George Joseph <george.joseph@fairview5.com> Acked-by: Jean Delvare <khali@linux-fr.org>
Esse commit está contido em:
@@ -657,7 +657,7 @@ static u16 pmbus_data2reg_direct(struct pmbus_data *data,
|
||||
static u16 pmbus_data2reg_vid(struct pmbus_data *data,
|
||||
enum pmbus_sensor_classes class, long val)
|
||||
{
|
||||
val = SENSORS_LIMIT(val, 500, 1600);
|
||||
val = clamp_val(val, 500, 1600);
|
||||
|
||||
return 2 + DIV_ROUND_CLOSEST((1600 - val) * 100, 625);
|
||||
}
|
||||
|
Referência em uma nova issue
Block a user