[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAG+cZ05LGBsNODyAaApS1uoPXPh7Cchp8utm_AAWoM09HZzOzw@mail.gmail.com>
Date: Wed, 31 Jul 2024 10:25:51 +0200
From: Piotr Wojtaszczyk <piotr.wojtaszczyk@...esys.com>
To: Yue Haibing <yuehaibing@...wei.com>
Cc: jonathan.downing@...tel.com, vz@...ia.com, lgirdwood@...il.com,
broonie@...nel.org, perex@...ex.cz, tiwai@...e.com,
alsa-devel@...a-project.org, linuxppc-dev@...ts.ozlabs.org,
linux-sound@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] ASoC: fsl: lpc3xxx-i2s: Remove set but not used
variable 'savedbitclkrate'
On Wed, Jul 31, 2024 at 4:39 AM Yue Haibing <yuehaibing@...wei.com> wrote:
>
> The variable savedbitclkrate is assigned and never used, so can be removed.
>
> sound/soc/fsl/lpc3xxx-i2s.c:42:13: warning: variable ‘savedbitclkrate’ set but not used [-Wunused-but-set-variable]
>
> Fixes: 0959de657a10 ("ASoC: fsl: Add i2s and pcm drivers for LPC32xx CPUs")
> Signed-off-by: Yue Haibing <yuehaibing@...wei.com>
> ---
> sound/soc/fsl/lpc3xxx-i2s.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/sound/soc/fsl/lpc3xxx-i2s.c b/sound/soc/fsl/lpc3xxx-i2s.c
> index af995ca081a3..62ef624d6dd4 100644
> --- a/sound/soc/fsl/lpc3xxx-i2s.c
> +++ b/sound/soc/fsl/lpc3xxx-i2s.c
> @@ -39,7 +39,7 @@ static void __lpc3xxx_find_clkdiv(u32 *clkx, u32 *clky, int freq, int xbytes, u3
> {
> u32 i2srate;
> u32 idxx, idyy;
> - u32 savedbitclkrate, diff, trate, baseclk;
> + u32 diff, trate, baseclk;
>
> /* Adjust rate for sample size (bits) and 2 channels and offset for
> * divider in clock output
> @@ -53,14 +53,12 @@ static void __lpc3xxx_find_clkdiv(u32 *clkx, u32 *clky, int freq, int xbytes, u3
>
> /* Find the best divider */
> *clkx = *clky = 0;
> - savedbitclkrate = 0;
> diff = ~0;
> for (idxx = 1; idxx < 0xFF; idxx++) {
> for (idyy = 1; idyy < 0xFF; idyy++) {
> trate = (baseclk * idxx) / idyy;
> if (abs(trate - i2srate) < diff) {
> diff = abs(trate - i2srate);
> - savedbitclkrate = trate;
> *clkx = idxx;
> *clky = idyy;
> }
> --
> 2.34.1
>
Looks good, thanks.
--
Piotr Wojtaszczyk
Timesys
Powered by blists - more mailing lists