summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/rt712-sdca.c
diff options
context:
space:
mode:
authorColin Ian King <colin.i.king@gmail.com>2025-05-07 15:09:07 +0100
committerMark Brown <broonie@kernel.org>2025-05-08 10:32:52 +0900
commit8147e75bd5f0977f6d389f6cdb4f10956cc3d88f (patch)
tree8ceec9b32bc7fe6a98b5abc428575f05a8788e67 /sound/soc/codecs/rt712-sdca.c
parentd75d38dc460452cc8bbca483dee65839e11c71fe (diff)
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 <colin.i.king@gmail.com> Link: https://patch.msgid.link/20250507140907.255562-1-colin.i.king@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/rt712-sdca.c')
-rw-r--r--sound/soc/codecs/rt712-sdca.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sound/soc/codecs/rt712-sdca.c b/sound/soc/codecs/rt712-sdca.c
index 19d99b9d4ab2..570c2af1245d 100644
--- a/sound/soc/codecs/rt712-sdca.c
+++ b/sound/soc/codecs/rt712-sdca.c
@@ -1065,12 +1065,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;
}