is_power_of_2 in rtctimer.c
Subsystems (2)
PATCH 1/1 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 <[email protected]>
---
sound/core/rtctimer.c +2 -1
@@ -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 ;
Signature · 8 lines
Regards, Vignesh Babu BM _____________________________________________________________ "Why is it that every time I'm with you, makes me believe in magic?" _______________________________________________ Kernel-janitors mailing list [email protected] https://lists.osdl.org/mailman/listinfo/kernel-janitors
At Wed, 21 Feb 2007 18:50:21 +0530,
Quoted 6 lines · Vignesh Babu BM
Replacing (n & (n-1)) in the context of power of 2 checks with
is_power_of_2Signed-off-by vignesh babu <[email protected]>
Thanks, I applied it to ALSA tree now.
Takashi
Quoted 46 lines
---
sound/core/rtctimer.c +2
-1@@ -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 ;Signature · 22 lines
-- Regards, Vignesh Babu BM _____________________________________________________________ "Why is it that every time I'm with you, makes me believe in magic?" The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV _______________________________________________ Alsa-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/alsa-devel
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors