From: Colin Ian King Date: Thu, 8 May 2025 08:45:27 +0000 (+0100) Subject: ASoC: rt712-sdca: remove redundant else path of if statement X-Git-Tag: v6.16-rc1~170^2~5^2~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4815e9fc892bb85f856f119006687fdb6c71ee01;p=thirdparty%2Flinux.git ASoC: rt712-sdca: remove redundant else path of if statement There is an if/else check where the else part is executed if adc_vol_flag is true, this else path checks if adc_vol_flag is true (which is a redundant second check) and the if path is always taken. Remove the redundant check and remove the else path since that can never occur. Signed-off-by: Colin Ian King Link: https://patch.msgid.link/20250508084527.316380-1-colin.i.king@gmail.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/rt712-sdca-dmic.c b/sound/soc/codecs/rt712-sdca-dmic.c index db011da63bd96..4d044dfa3136e 100644 --- a/sound/soc/codecs/rt712-sdca-dmic.c +++ b/sound/soc/codecs/rt712-sdca-dmic.c @@ -263,12 +263,8 @@ static int rt712_sdca_dmic_set_gain_get(struct snd_kcontrol *kcontrol, if (!adc_vol_flag) /* boost gain */ ctl = regvalue / 0x0a00; - else { /* ADC gain */ - if (adc_vol_flag) - ctl = p->max - (((0x1e00 - regvalue) & 0xffff) / interval_offset); - else - ctl = p->max - (((0 - regvalue) & 0xffff) / interval_offset); - } + else /* ADC gain */ + ctl = p->max - (((0x1e00 - regvalue) & 0xffff) / interval_offset); ucontrol->value.integer.value[i] = ctl; }