Skip to content

Commit

Permalink
[ALSA] is_power_of_2 in rtctimer.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
vignesh babu authored and Jaroslav Kysela committed May 11, 2007
1 parent ac51902 commit 62e96a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sound/core/rtctimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 62e96a1

Please sign in to comment.