is_power_of_2-sound/pcm_params.h
Subsystems (2)
PATCH 1/1 is_power_of_2-sound/pcm_params.h
Replacing (n & (n-1)) in the context of power of 2 checks with is_power_of_2
Signed-off-by vignesh babu <[email protected]>
---
include/sound/pcm_params.h +2 -1
@@ -21,6 +21,7 @@* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ +#include <linux/log2.h> int snd_pcm_hw_param_first(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params,
@@ -170,7 +171,7 @@ static inline int snd_mask_single(const struct snd_mask *mask)for (i =0 ; i <SNDRV_MASK_SIZE ; i++) {if (! mask->bits[i])continue ; -if (mask->bits[i] & (mask->bits[i] -1 )) +if (!is_power_of_2 (mask->bits[i]))return 0 ;if (c)return 0 ;
Signature · 3 lines
Vignesh Babu BM _____________________________________________________________ "Why is it that every time I'm with you, makes me believe in magic?"