ASoC: da732x: simplify code
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fri, 26 Mar 2021 22:16:19 +0000 (17:16 -0500)
committerMark Brown <broonie@kernel.org>
Wed, 31 Mar 2021 17:00:38 +0000 (18:00 +0100)
commit945b0b58c5d7c6640f9aad2096e4675bc7f5371c
treee4e6b143c4462f07c749f2deac120fffbaa60370
parent458c23c509f66c5950da7e5496ea952ad15128f7
ASoC: da732x: simplify code

cppcheck reports a false positive:

sound/soc/codecs/da732x.c:1161:25: warning: Either the condition
'indiv<0' is redundant or there is division by zero at line
1161. [zerodivcond]
 fref = (da732x->sysclk / indiv);
                        ^
sound/soc/codecs/da732x.c:1158:12: note: Assuming that condition
'indiv<0' is not redundant
 if (indiv < 0)
           ^
sound/soc/codecs/da732x.c:1161:25: note: Division by zero
 fref = (da732x->sysclk / indiv);
                        ^

The code is awfully convoluted/confusing and can be simplified with a
single variable and the BIT macro.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210326221619.949961-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/da732x.c
sound/soc/codecs/da732x.h