From: "Robert P. J. Day" Use is_power_of_2() macro for simplicity. Signed-off-by: Robert P. J. Day Signed-off-by: Alessandro Zummo Cc: David Brownell Signed-off-by: Andrew Morton --- drivers/rtc/rtc-s3c.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff -puN drivers/rtc/rtc-s3c.c~rtc-s3c-use-is_power_of_2-macro-for-simplicity drivers/rtc/rtc-s3c.c --- a/drivers/rtc/rtc-s3c.c~rtc-s3c-use-is_power_of_2-macro-for-simplicity +++ a/drivers/rtc/rtc-s3c.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -309,9 +310,7 @@ static int s3c_rtc_ioctl(struct device * break; case RTC_IRQP_SET: - /* check for power of 2 */ - - if ((arg & (arg-1)) != 0 || arg < 1) { + if (!is_power_of_2(arg)) { ret = -EINVAL; goto exit; } _