From nobody Fri Oct 24 20:20:08 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17F61C28B2C for ; Mon, 15 Aug 2022 22:48:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351599AbiHOWpr (ORCPT ); Mon, 15 Aug 2022 18:45:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351258AbiHOWlp (ORCPT ); Mon, 15 Aug 2022 18:41:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBA4A73926; Mon, 15 Aug 2022 12:52:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E70076125C; Mon, 15 Aug 2022 19:52:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4B68C433D6; Mon, 15 Aug 2022 19:52:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593129; bh=FlydeP6PYQGyn0AYt0muUhmpUF8x2hn0JEyYh0BdFuw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QfF1BUi1344SR8SeyMUsNFO2FnSNlrqwSybJnLhP5E0fLVd9PGlrbLf1qqGjVfsm4 16cIft6JFYZI0VHk10jyz0g5WzksY3gLshR0shfXcRHYlViixqYeUOPNBvEsH7uUzL pM1tLrMT/TVGisIap/DhmCHU56n3mkFugB04x8N4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shengjiu Wang , Mark Brown , Sasha Levin Subject: [PATCH 5.18 0900/1095] ASoC: fsl_asrc: force cast the asrc_format type Date: Mon, 15 Aug 2022 20:04:59 +0200 Message-Id: <20220815180506.534797777@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Shengjiu Wang [ Upstream commit c49932726de24405d45516b3f8ad2735714fdf05 ] Fix sparse warning: sound/soc/fsl/fsl_asrc.c:1177:60: sparse: warning: incorrect type in argume= nt 3 (different base types) sound/soc/fsl/fsl_asrc.c:1177:60: sparse: expected unsigned int [usertyp= e] *out_value sound/soc/fsl/fsl_asrc.c:1177:60: sparse: got restricted snd_pcm_format_= t * sound/soc/fsl/fsl_asrc.c:1200:47: sparse: warning: restricted snd_pcm_forma= t_t degrades to integer Fixes: 4520af41fd21 ("ASoC: fsl_asrc: Support new property fsl,asrc-format") Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1658399393-28777-3-git-send-email-shengjiu.= wang@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/fsl/fsl_asrc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c index d7d1536a4f37..44dcbf49456c 100644 --- a/sound/soc/fsl/fsl_asrc.c +++ b/sound/soc/fsl/fsl_asrc.c @@ -1066,6 +1066,7 @@ static int fsl_asrc_probe(struct platform_device *pde= v) struct resource *res; void __iomem *regs; int irq, ret, i; + u32 asrc_fmt =3D 0; u32 map_idx; char tmp[16]; u32 width; @@ -1174,7 +1175,8 @@ static int fsl_asrc_probe(struct platform_device *pde= v) return ret; } =20 - ret =3D of_property_read_u32(np, "fsl,asrc-format", &asrc->asrc_format); + ret =3D of_property_read_u32(np, "fsl,asrc-format", &asrc_fmt); + asrc->asrc_format =3D (__force snd_pcm_format_t)asrc_fmt; if (ret) { ret =3D of_property_read_u32(np, "fsl,asrc-width", &width); if (ret) { @@ -1197,7 +1199,7 @@ static int fsl_asrc_probe(struct platform_device *pde= v) } } =20 - if (!(FSL_ASRC_FORMATS & (1ULL << asrc->asrc_format))) { + if (!(FSL_ASRC_FORMATS & pcm_format_to_bits(asrc->asrc_format))) { dev_warn(&pdev->dev, "unsupported width, use default S24_LE\n"); asrc->asrc_format =3D SNDRV_PCM_FORMAT_S24_LE; } --=20 2.35.1