[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <98942933af31a9e003b5d1a809a22a93a736c381.camel@gmail.com>
Date: Thu, 28 Aug 2025 11:48:17 +0100
From: Nuno Sá <noname.nuno@...il.com>
To: Qianfeng Rong <rongqianfeng@...o.com>, Lars-Peter Clausen
<lars@...afoo.de>, Nuno Sá <nuno.sa@...log.com>, Liam
Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>, Jaroslav
Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>, "open list:ANALOG
DEVICES INC ASOC CODEC DRIVERS" <linux-sound@...r.kernel.org>, open list
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/3] ASoC: adau1977: use int type to store negative
error codes
On Thu, 2025-08-28 at 15:53 +0800, Qianfeng Rong wrote:
> Change the 'ret' variable from unsigned int to int to store negative error
> codes or zero returned by regmap_update_bits().
>
> Storing the negative error codes in unsigned type, doesn't cause an issue
> at runtime but it's ugly as pants. Additionally, assigning negative error
> codes to unsigned type may trigger a GCC warning when the -Wsign-conversion
> flag is enabled.
>
> No effect on runtime.
>
> Signed-off-by: Qianfeng Rong <rongqianfeng@...o.com>
> ---
Reviewed-by: Nuno Sá <nuno.sa@...log.com>
> sound/soc/codecs/adau1977.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/soc/codecs/adau1977.c b/sound/soc/codecs/adau1977.c
> index ae59efb38f26..c193a9f22f59 100644
> --- a/sound/soc/codecs/adau1977.c
> +++ b/sound/soc/codecs/adau1977.c
> @@ -795,7 +795,7 @@ static int adau1977_set_sysclk(struct snd_soc_component
> *component,
> struct adau1977 *adau1977 = snd_soc_component_get_drvdata(component);
> unsigned int mask = 0;
> unsigned int clk_src;
> - unsigned int ret;
> + int ret;
>
> if (dir != SND_SOC_CLOCK_IN)
> return -EINVAL;
Powered by blists - more mailing lists