Home
last modified time | relevance | path

Searched hist:"945 b0b58c5d7c6640f9aad2096e4675bc7f5371c" (Results 1 – 2 of 2) sorted by relevance

/linux/sound/soc/codecs/
H A Dda732x.hdiff 945b0b58c5d7c6640f9aad2096e4675bc7f5371c Fri Mar 26 23:16:19 CET 2021 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> 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>
H A Dda732x.cdiff 945b0b58c5d7c6640f9aad2096e4675bc7f5371c Fri Mar 26 23:16:19 CET 2021 Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> 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>