[PATCH 02/16] ASoC: cs42l42: remove redundant test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx>
Reviewed-by: Bard Liao <yung-chuan.liao@xxxxxxxxxxxxxxx>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@xxxxxxxxxxxxxxx>
---
 sound/soc/codecs/cs42l42.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c
index 4fade23887972..6ca74c0d46eaa 100644
--- a/sound/soc/codecs/cs42l42.c
+++ b/sound/soc/codecs/cs42l42.c
@@ -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;
 		}
 	}
 
-- 
2.30.2




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux