linux-6.5/sound/soc/codecs/rt722-sdca.c:612: some confused logic ?
31 Aug
2023
31 Aug
'23
1:08 p.m.
Hello there,
I just ran cppcheck over the source code of linux-6.5. It said:
linux-6.5/sound/soc/codecs/rt722-sdca.c:612:8: style: Expression is always true because 'else if' condition is opposite to previous condition at line 609. [multiCondition]
Source code is
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); }
This code might benefit from some rework.
Regards
David Binderman
479
Age (days ago)
479
Last active (days ago)
0 comments
1 participants
participants (1)
-
David Binderman