[<prev] [next>] [day] [month] [year] [list]
Message-ID: <DB6P189MB0568614C31BD33913615C4769CE5A@DB6P189MB0568.EURP189.PROD.OUTLOOK.COM>
Date: Thu, 31 Aug 2023 11:08:13 +0000
From: David Binderman <dcb314@...mail.com>
To: "oder_chiou@...ltek.com" <oder_chiou@...ltek.com>,
"lgirdwood@...il.com" <lgirdwood@...il.com>,
"broonie@...nel.org" <broonie@...nel.org>,
"perex@...ex.cz" <perex@...ex.cz>,
"tiwai@...e.com" <tiwai@...e.com>,
"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: linux-6.5/sound/soc/codecs/rt722-sdca.c:612: some confused logic ?
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
Powered by blists - more mailing lists