summaryrefslogtreecommitdiffstats
path: root/sound/core/rtctimer.c
diff options
context:
space:
mode:
authorvignesh babu <vignesh.babu@wipro.com>2007-02-22 13:23:01 +0100
committerJaroslav Kysela <perex@suse.cz>2007-05-11 16:55:42 +0200
commit62e96a1caab86e0d3688d59fcb6f682cc52d4917 (patch)
tree26ffc1fab5bf2a3b5660ba43fdf06d1ff4bcfccd /sound/core/rtctimer.c
parentac519028a4e7b919eaff65a1535824259df326c6 (diff)
downloadlinux-62e96a1caab86e0d3688d59fcb6f682cc52d4917.tar.bz2
[ALSA] is_power_of_2 in rtctimer.c
Replacing (n & (n-1)) in the context of power of 2 checks with is_power_of_2 Signed-off-by: vignesh babu <vignesh.babu@wipro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/core/rtctimer.c')
-rw-r--r--sound/core/rtctimer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/core/rtctimer.c b/sound/core/rtctimer.c
index 9f7b32e1ccde..7cd5e8f5d4ce 100644
--- a/sound/core/rtctimer.c
+++ b/sound/core/rtctimer.c
@@ -24,6 +24,7 @@
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/moduleparam.h>
+#include <linux/log2.h>
#include <sound/core.h>
#include <sound/timer.h>
@@ -129,7 +130,7 @@ static int __init rtctimer_init(void)
struct snd_timer *timer;
if (rtctimer_freq < 2 || rtctimer_freq > 8192 ||
- (rtctimer_freq & (rtctimer_freq - 1)) != 0) {
+ !is_power_of_2(rtctimer_freq)) {
snd_printk(KERN_ERR "rtctimer: invalid frequency %d\n",
rtctimer_freq);
return -EINVAL;