ASoC: cs42l42: remove redundant test
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fri, 20 May 2022 21:17:05 +0000 (16:17 -0500)
committerMark Brown <broonie@kernel.org>
Mon, 6 Jun 2022 11:35:08 +0000 (12:35 +0100)
cppcheck warning:

sound/soc/codecs/cs42l42.c:1704:28: style: The statement 'if
(cs42l42->plug_state!=CS42L42_TS_TRANS)
cs42l42->plug_state=CS42L42_TS_TRANS' is logically equivalent to
'cs42l42->plug_state=CS42L42_TS_TRANS'. [duplicateConditionalAssign]
   if (cs42l42->plug_state != CS42L42_TS_TRANS)
                           ^
sound/soc/codecs/cs42l42.c:1705:25: note: Assignment
'cs42l42->plug_state=CS42L42_TS_TRANS'
    cs42l42->plug_state = CS42L42_TS_TRANS;
                        ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220520211719.607543-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cs42l42.c

index 4fade23..6ca74c0 100644 (file)
@@ -1701,8 +1701,7 @@ static irqreturn_t cs42l42_irq_thread(int irq, void *data)
                        break;
 
                default:
-                       if (cs42l42->plug_state != CS42L42_TS_TRANS)
-                               cs42l42->plug_state = CS42L42_TS_TRANS;
+                       cs42l42->plug_state = CS42L42_TS_TRANS;
                }
        }