[alsa-devel] [PATCH 10/10] ALSA: xen: Use standard pcm_format_to_bits() for ALSA format bits
Oleksandr Andrushchenko
andr2000 at gmail.com
Mon Jul 30 09:35:58 CEST 2018
Hello, Takashi!
> Date: Wed, 25 Jul 2018 23:19:45 +0200
> From: Takashi Iwai <tiwai at suse.de>
> To: alsa-devel at alsa-project.org
> Subject: [alsa-devel] [PATCH 10/10] ALSA: xen: Use standard
> pcm_format_to_bits() for ALSA format bits
> Message-ID: <20180725211945.19222-11-tiwai at suse.de>
>
> The open codes with the bit shift in xen_snd_front_alsa.c give sparse
> warnings as the PCM format type is with __bitwise.
> There is already a standard macro to get the format bits, so let's use
> it instead.
>
> This fixes sparse warnings like:
> sound/xen/xen_snd_front_alsa.c:191:47: warning: restricted snd_pcm_format_t degrades to integer
>
> Signed-off-by: Takashi Iwai <tiwai at suse.de>
> ---
> sound/xen/xen_snd_front_alsa.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sound/xen/xen_snd_front_alsa.c b/sound/xen/xen_snd_front_alsa.c
> index 5a2bd70a2fa1..129180e17db1 100644
> --- a/sound/xen/xen_snd_front_alsa.c
> +++ b/sound/xen/xen_snd_front_alsa.c
> @@ -188,7 +188,7 @@ static u64 to_sndif_formats_mask(u64 alsa_formats)
>
> mask = 0;
> for (i = 0; i < ARRAY_SIZE(ALSA_SNDIF_FORMATS); i++)
> - if (1 << ALSA_SNDIF_FORMATS[i].alsa & alsa_formats)
> + if (pcm_format_to_bits(ALSA_SNDIF_FORMATS[i].alsa) & alsa_formats)
> mask |= 1 << ALSA_SNDIF_FORMATS[i].sndif;
>
> return mask;
> @@ -202,7 +202,7 @@ static u64 to_alsa_formats_mask(u64 sndif_formats)
> mask = 0;
> for (i = 0; i < ARRAY_SIZE(ALSA_SNDIF_FORMATS); i++)
> if (1 << ALSA_SNDIF_FORMATS[i].sndif & sndif_formats)
> - mask |= 1 << ALSA_SNDIF_FORMATS[i].alsa;
> + mask |= pcm_format_to_bits(ALSA_SNDIF_FORMATS[i].alsa);
>
> return mask;
> }
Thank you for your patch,
Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko at epam.com>
Thank you,
Oleksandr
More information about the Alsa-devel
mailing list