From 62e96a1caab86e0d3688d59fcb6f682cc52d4917 Mon Sep 17 00:00:00 2001 From: vignesh babu Date: Thu, 22 Feb 2007 13:23:01 +0100 Subject: [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 Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- sound/core/rtctimer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sound/core/rtctimer.c') diff --git a/sound/core/rtctimer.c b/sound/core/rtctimer.c index 9f7b32e1ccd..7cd5e8f5d4c 100644 --- a/sound/core/rtctimer.c +++ b/sound/core/rtctimer.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -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; -- cgit v1.2.3-70-g09d2