Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (adt7470) Replace power-of-two test

Since <linux/log2.h> already supplies a power-of-two test, there's no
point in having this source file redefine it again.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>

authored by

Robert P. J. Day and committed by
Mark M. Hoffman
ce9c2f44 5aebefb0

+1 -3
+1 -3
drivers/hwmon/adt7470.c
··· 114 114 /* sleep 1s while gathering temperature data */ 115 115 #define TEMP_COLLECTION_TIME 1000 116 116 117 - #define power_of_2(x) (((x) & ((x) - 1)) == 0) 118 - 119 117 /* datasheet says to divide this number by the fan reading to get fan rpm */ 120 118 #define FAN_PERIOD_TO_RPM(x) ((90000 * 60) / (x)) 121 119 #define FAN_RPM_TO_PERIOD FAN_PERIOD_TO_RPM ··· 675 677 { 676 678 if (input == ADT7470_PWM_ALL_TEMPS) 677 679 return 0; 678 - if (input < 1 || !power_of_2(input)) 680 + if (input < 1 || !is_power_of_2(input)) 679 681 return -EINVAL; 680 682 return ilog2(input) + 1; 681 683 }