Skip to content

Commit 4815e9f

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 07cb9b5 commit 4815e9f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

sound/soc/codecs/rt712-sdca-dmic.c

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

264264
if (!adc_vol_flag) /* boost gain */
265265
ctl = regvalue / 0x0a00;
266-
else { /* ADC gain */
267-
if (adc_vol_flag)
268-
ctl = p->max - (((0x1e00 - regvalue) & 0xffff) / interval_offset);
269-
else
270-
ctl = p->max - (((0 - regvalue) & 0xffff) / interval_offset);
271-
}
266+
else /* ADC gain */
267+
ctl = p->max - (((0x1e00 - regvalue) & 0xffff) / interval_offset);
272268

273269
ucontrol->value.integer.value[i] = ctl;
274270
}

0 commit comments

Comments
 (0)