ASoC: soc-core: remove always-false path
cppcheck throws the following warning: sound/soc/soc-core.c:2773:6: style: Condition '!num_widgets' is always false [knownConditionTrueFalse] if (!num_widgets) { ^ sound/soc/soc-core.c:2761:18: note: Assuming that condition 'num_widgets<0' is not redundant if (num_widgets < 0) { ^ sound/soc/soc-core.c:2766:18: note: Assuming condition is false if (num_widgets & 1) { ^ sound/soc/soc-core.c:2772:2: note: Compound assignment '/=', assigned value is 0 num_widgets /= 2; ^ We should check upfront all error conditions. Signed-off-by:Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by:
Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by:
Rander Wang <rander.wang@intel.com> Reviewed-by:
Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20220421162505.302132-1-pierre-louis.bossart@linux.intel.comSigned-off-by:
Mark Brown <broonie@kernel.org>
Showing
Please register or sign in to comment