提交 62e96a1c 编写于 作者: V vignesh babu 提交者: Jaroslav Kysela

[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: Nvignesh babu <vignesh.babu@wipro.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
Signed-off-by: NJaroslav Kysela <perex@suse.cz>
上级 ac519028
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册