lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aab81b14-415f-45ab-84f1-be9ed11e2a18@linuxfoundation.org>
Date: Tue, 8 Oct 2024 16:56:39 -0600
From: Shuah Khan <skhan@...uxfoundation.org>
To: "Everest K.C." <everestkc@...restkc.com.np>, oder_chiou@...ltek.com,
 lgirdwood@...il.com, broonie@...nel.org, perex@...ex.cz, tiwai@...e.com
Cc: linux-sound@...r.kernel.org, linux-kernel@...r.kernel.org,
 Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH] ASoC: rt721-sdca: Clean logically deadcode in
 rt721-sdca.c

On 10/8/24 11:41, Everest K.C. wrote:
> As the same condition was checked in inner and outer if
> statements. The code never reaches the inner else statement.
> 

Looks like this file is only on next. Use next in the prefix
[PATCH-next]

How did you find this problem? Include it in the change log.

> Signed-off-by: Everest K.C. <everestkc@...restkc.com.np>
> ---
>   sound/soc/codecs/rt721-sdca.c | 10 +++-------
>   1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/sound/soc/codecs/rt721-sdca.c b/sound/soc/codecs/rt721-sdca.c
> index 36056cb7a3ca..4fd26e490610 100644
> --- a/sound/soc/codecs/rt721-sdca.c
> +++ b/sound/soc/codecs/rt721-sdca.c
> @@ -611,13 +611,9 @@ static int rt721_sdca_dmic_set_gain_get(struct snd_kcontrol *kcontrol,
>   
>   		if (!adc_vol_flag) /* boost gain */
>   			ctl = regvalue / boost_step;
> -		else { /* ADC gain */
> -			if (adc_vol_flag)
> -				ctl = p->max - (((vol_max - regvalue) & 0xffff) / interval_offset);
> -			else
> -				ctl = p->max - (((0 - regvalue) & 0xffff) / interval_offset);
> -		}
> -
> +		else /* ADC gain */
> +			ctl = p->max - (((vol_max - regvalue) & 0xffff) / interval_offset);
> +
>   		ucontrol->value.integer.value[i] = ctl;
>   	}
>   

Looks reasonable to me. I don't see adc_vol_flag changing.
Possible copy error from sound/soc/codecs/rt722-sdca.c

Perhaps rt722-sdca.c came from sound/soc/codecs/rt712-sdca.c
in which the logic seems to be correct.

In any case, I will leave it to sound experts to comment whether this
patch is correct or not.

thanks,
-- Shuah

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ