From: Vignesh Babu BM Date: Mon, 19 Feb 2007 09:12:15 +0000 Subject: [KJ] [PATCH][RESEND] is_power_of_2 in rtc Message-Id: <1171875615.6127.37.camel@wriver-t81fb058.linuxcoe> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kernel-janitors@vger.kernel.org Replacing (n & (n-1)) in the context of power of 2 checks with is_power_of_2...resent to fix a change in the logic Signed-off-by: vignesh babu --- diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index f406a2b..212ec32 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -311,7 +312,7 @@ static int s3c_rtc_ioctl(struct device *dev, 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; } _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.osdl.org https://lists.osdl.org/mailman/listinfo/kernel-janitors