Skip to content

Commit 8147e75

Browse files
ColinIanKingbroonie
authored andcommitted
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent d75d38d commit 8147e75

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

sound/soc/codecs/rt712-sdca.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,12 +1065,8 @@ static int rt712_sdca_dmic_set_gain_get(struct snd_kcontrol *kcontrol,
10651065

10661066
if (!adc_vol_flag) /* boost gain */
10671067
ctl = regvalue / 0x0a00;
1068-
else { /* ADC gain */
1069-
if (adc_vol_flag)
1070-
ctl = p->max - (((0x1e00 - regvalue) & 0xffff) / interval_offset);
1071-
else
1072-
ctl = p->max - (((0 - regvalue) & 0xffff) / interval_offset);
1073-
}
1068+
else /* ADC gain */
1069+
ctl = p->max - (((0x1e00 - regvalue) & 0xffff) / interval_offset);
10741070

10751071
ucontrol->value.integer.value[i] = ctl;
10761072
}

0 commit comments

Comments
 (0)