diff options
author | vignesh babu <vignesh.babu@wipro.com> | 2007-02-22 07:23:01 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2007-05-11 10:55:42 -0400 |
commit | 62e96a1caab86e0d3688d59fcb6f682cc52d4917 (patch) | |
tree | 26ffc1fab5bf2a3b5660ba43fdf06d1ff4bcfccd /sound/core | |
parent | ac519028a4e7b919eaff65a1535824259df326c6 (diff) |
[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')
-rw-r--r-- | sound/core/rtctimer.c | 3 |
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 @@ | |||
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/interrupt.h> | 25 | #include <linux/interrupt.h> |
26 | #include <linux/moduleparam.h> | 26 | #include <linux/moduleparam.h> |
27 | #include <linux/log2.h> | ||
27 | #include <sound/core.h> | 28 | #include <sound/core.h> |
28 | #include <sound/timer.h> | 29 | #include <sound/timer.h> |
29 | 30 | ||
@@ -129,7 +130,7 @@ static int __init rtctimer_init(void) | |||
129 | struct snd_timer *timer; | 130 | struct snd_timer *timer; |
130 | 131 | ||
131 | if (rtctimer_freq < 2 || rtctimer_freq > 8192 || | 132 | if (rtctimer_freq < 2 || rtctimer_freq > 8192 || |
132 | (rtctimer_freq & (rtctimer_freq - 1)) != 0) { | 133 | !is_power_of_2(rtctimer_freq)) { |
133 | snd_printk(KERN_ERR "rtctimer: invalid frequency %d\n", | 134 | snd_printk(KERN_ERR "rtctimer: invalid frequency %d\n", |
134 | rtctimer_freq); | 135 | rtctimer_freq); |
135 | return -EINVAL; | 136 | return -EINVAL; |