aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hwmon/adt7470.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/hwmon/adt7470.c b/drivers/hwmon/adt7470.c
index 9810aaa0489..a2155605e31 100644
--- a/drivers/hwmon/adt7470.c
+++ b/drivers/hwmon/adt7470.c
@@ -114,8 +114,6 @@ I2C_CLIENT_INSMOD_1(adt7470);
114/* sleep 1s while gathering temperature data */ 114/* sleep 1s while gathering temperature data */
115#define TEMP_COLLECTION_TIME 1000 115#define TEMP_COLLECTION_TIME 1000
116 116
117#define power_of_2(x) (((x) & ((x) - 1)) == 0)
118
119/* datasheet says to divide this number by the fan reading to get fan rpm */ 117/* datasheet says to divide this number by the fan reading to get fan rpm */
120#define FAN_PERIOD_TO_RPM(x) ((90000 * 60) / (x)) 118#define FAN_PERIOD_TO_RPM(x) ((90000 * 60) / (x))
121#define FAN_RPM_TO_PERIOD FAN_PERIOD_TO_RPM 119#define FAN_RPM_TO_PERIOD FAN_PERIOD_TO_RPM
@@ -677,7 +675,7 @@ static int cvt_auto_temp(int input)
677{ 675{
678 if (input == ADT7470_PWM_ALL_TEMPS) 676 if (input == ADT7470_PWM_ALL_TEMPS)
679 return 0; 677 return 0;
680 if (input < 1 || !power_of_2(input)) 678 if (input < 1 || !is_power_of_2(input))
681 return -EINVAL; 679 return -EINVAL;
682 return ilog2(input) + 1; 680 return ilog2(input) + 1;
683} 681}