OSDN Git Service

ASoC: fsl: fsl_ssi: remove unnecessary tests
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fri, 19 Feb 2021 23:29:33 +0000 (17:29 -0600)
committerMark Brown <broonie@kernel.org>
Wed, 10 Mar 2021 13:06:39 +0000 (13:06 +0000)
commit2fb563567bc425b9a7371f1432c62e25627e1754
treefa430c6b8ac65a1a4c757a95a0de02ddeee8db28
parent8f6fef01a5ba48b416d1dc7e910268e03d270a10
ASoC: fsl: fsl_ssi: remove unnecessary tests

cppcheck warnings:

sound/soc/fsl/fsl_ssi.c:767:34: style: Condition 'div2' is always
false [knownConditionTrueFalse]
 stccr = SSI_SxCCR_PM(pm + 1) | (div2 ? SSI_SxCCR_DIV2 : 0) |
                                 ^
sound/soc/fsl/fsl_ssi.c:722:9: note: Assignment 'div2=0', assigned value is 0
 div2 = 0;
        ^
sound/soc/fsl/fsl_ssi.c:767:34: note: Condition 'div2' is always false
 stccr = SSI_SxCCR_PM(pm + 1) | (div2 ? SSI_SxCCR_DIV2 : 0) |
                                 ^
sound/soc/fsl/fsl_ssi.c:768:4: style: Condition 'psr' is always false
[knownConditionTrueFalse]
  (psr ? SSI_SxCCR_PSR : 0);
   ^
sound/soc/fsl/fsl_ssi.c:721:8: note: Assignment 'psr=0', assigned
value is 0
 psr = 0;
       ^
sound/soc/fsl/fsl_ssi.c:768:4: note: Condition 'psr' is always false
  (psr ? SSI_SxCCR_PSR : 0);
   ^

Upon further analysis, the variables 'div2' and 'psr' are set to zero
and never modified. All the tests can be removed.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210219232937.6440-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_ssi.c