From: Shuah Khan <skhan@linuxfoundation.org>
To: "Everest K.C." <everestkc@everestkc.com.np>,
oder_chiou@realtek.com, lgirdwood@gmail.com, broonie@kernel.org,
perex@perex.cz, tiwai@suse.com
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH-next V2] ASoC: rt721-sdca: Clean logically deadcode in rt721-sdca.c
Date: Thu, 10 Oct 2024 09:08:54 -0600 [thread overview]
Message-ID: <e44527e8-b7c6-4712-97a6-d54f02ad2dc9@linuxfoundation.org> (raw)
In-Reply-To: <20241008234422.5274-1-everestkc@everestkc.com.np>
On 10/8/24 17:44, Everest K.C. wrote:
> As the same condition was checked in inner and outer if
> statements. The code never reaches the inner else statement.
>
> This issue was reported by Coverity Scan with CID = 1600271.
>
> Signed-off-by: Everest K.C. <everestkc@everestkc.com.np>
> ---
> V1 -> V2: - Updated the patch prefix to PATCH-next
> - Added how the issue was discovered
>
> 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;
> }
>
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
As mentioned in my review for v1 of this patch, the exact same problem
exists in sound/soc/codecs/rt722-sdca.c as well, in case you want to send
patch to fix that one.
thanks,
-- Shuah
next prev parent reply other threads:[~2024-10-10 15:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-08 23:44 Everest K.C.
2024-10-10 14:49 ` Mark Brown
2024-10-10 15:08 ` Shuah Khan [this message]
2024-10-10 18:01 ` Everest K.C.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e44527e8-b7c6-4712-97a6-d54f02ad2dc9@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=broonie@kernel.org \
--cc=everestkc@everestkc.com.np \
--cc=kernel-janitors@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=oder_chiou@realtek.com \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®