From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-eopbgr680092.outbound.protection.outlook.com ([40.107.68.92]:55808 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728630AbeIBRVb (ORCPT ); Sun, 2 Sep 2018 13:21:31 -0400 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Takashi Iwai , Sasha Levin Subject: [PATCH AUTOSEL 4.18 116/131] ALSA: xen: Use standard pcm_format_to_bits() for ALSA format bits Date: Sun, 2 Sep 2018 13:05:27 +0000 Message-ID: <20180902064601.183036-116-alexander.levin@microsoft.com> References: <20180902064601.183036-1-alexander.levin@microsoft.com> In-Reply-To: <20180902064601.183036-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Takashi Iwai [ Upstream commit 3ac14b3960185d4c8a2f14b84042aa1aa8531d88 ] 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 Signed-off-by: Sasha Levin --- 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) =20 mask =3D 0; for (i =3D 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 |=3D 1 << ALSA_SNDIF_FORMATS[i].sndif; =20 return mask; @@ -202,7 +202,7 @@ static u64 to_alsa_formats_mask(u64 sndif_formats) mask =3D 0; for (i =3D 0; i < ARRAY_SIZE(ALSA_SNDIF_FORMATS); i++) if (1 << ALSA_SNDIF_FORMATS[i].sndif & sndif_formats) - mask |=3D 1 << ALSA_SNDIF_FORMATS[i].alsa; + mask |=3D pcm_format_to_bits(ALSA_SNDIF_FORMATS[i].alsa); =20 return mask; } --=20 2.17.1