From 9974b6ea7b85a32f34f824443f47aa501c85ee8f Mon Sep 17 00:00:00 2001 From: "Robert P. J. Day" Date: Wed, 6 Feb 2008 01:38:42 -0800 Subject: rtc-s3c: Use is_power_of_2() macro for simplicity. 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 Signed-off-by: Linus Torvalds --- drivers/rtc/rtc-s3c.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/rtc/rtc-s3c.c') diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index e2041b4d0c8..86766f1f249 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/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 *dev, 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; } -- cgit v1.2.3