From: Oleksandr Andrushchenko <andr2000@gmail.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: xen-devel <xen-devel@lists.xenproject.org>, alsa-devel@alsa-project.org
Subject: Re: [PATCH 10/10] ALSA: xen: Use standard pcm_format_to_bits() for ALSA format bits
Date: Mon, 30 Jul 2018 10:35:58 +0300 [thread overview]
Message-ID: <cdf3db6c-e6dc-68c1-258f-106365cf5647@gmail.com> (raw)
In-Reply-To: <mailman.653.1532553863.753.alsa-devel@alsa-project.org>
Hello, Takashi!
> Date: Wed, 25 Jul 2018 23:19:45 +0200
> From: Takashi Iwai <tiwai@suse.de>
> To: alsa-devel@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@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@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@epam.com>
Thank you,
Oleksandr
next parent reply other threads:[~2018-07-30 7:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.653.1532553863.753.alsa-devel@alsa-project.org>
2018-07-30 7:35 ` Oleksandr Andrushchenko [this message]
2018-07-25 21:19 [PATCH 00/10] ALSA: yet more PCM format type conversion fixes Takashi Iwai
2018-07-25 21:19 ` [PATCH 10/10] ALSA: xen: Use standard pcm_format_to_bits() for ALSA format bits Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cdf3db6c-e6dc-68c1-258f-106365cf5647@gmail.com \
--to=andr2000@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=tiwai@suse.de \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).