Skip to content

Commit

Permalink
rtc-s3c: Use is_power_of_2() macro for simplicity.
Browse files Browse the repository at this point in the history
Use is_power_of_2() macro for simplicity.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Robert P. J. Day authored and Linus Torvalds committed Feb 6, 2008
1 parent 037e291 commit 9974b6e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/rtc/rtc-s3c.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <linux/rtc.h>
#include <linux/bcd.h>
#include <linux/clk.h>
#include <linux/log2.h>

#include <asm/hardware.h>
#include <asm/uaccess.h>
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 9974b6e

Please sign in to comment.