]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit2ce70a8f2ea4b1f6a5d399f2e1f81dd42db59d1f
treee4e6b143c4462f07c749f2deac120fffbaa60370
parentcbb27a65e39391669771ecd2d5ab74a06282abbb
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