[alsa-devel] [PATCH]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 vignesh.babu@wipro.com --- diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h index 85cf1cf..dee298e 100644 --- a/include/sound/pcm_params.h +++ b/include/sound/pcm_params.h @@ -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;
participants (1)
-
vignesh babu