From: Robert P. J. Day Date: Wed, 6 Feb 2008 09:38:42 +0000 (-0800) Subject: rtc-s3c: Use is_power_of_2() macro for simplicity. X-Git-Tag: v2.6.25-rc1~621 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=9974b6ea7b85a32f34f824443f47aa501c85ee8f;p=linux-2.6-omap-h63xx.git 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 --- 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; }