[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220822184239.169757-3-pierre-louis.bossart@linux.intel.com>
Date: Mon, 22 Aug 2022 20:42:36 +0200
From: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To: alsa-devel@...a-project.org
Cc: tiwai@...e.de, broonie@...nel.org,
Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
Bard Liao <yung-chuan.liao@...ux.intel.com>,
Kai Vehmanen <kai.vehmanen@...ux.intel.com>,
Chao Song <chao.song@...el.com>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
Banajit Goswami <bgoswami@...cinc.com>,
Liam Girdwood <lgirdwood@...il.com>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
linux-kernel@...r.kernel.org (open list)
Subject: [PATCH 2/5] ASoC: wcd-mbhc-v2: remove always-true condition
cppcheck warning:
sound/soc/codecs/wcd-mbhc-v2.c:1192:26: style: Condition
'cross_conn<0' is always true [knownConditionTrueFalse]
} else if (cross_conn < 0) /* Error */
^
sound/soc/codecs/wcd-mbhc-v2.c:1188:15: note: Assuming that condition
'!cross_conn' is not redundant
} else if (!cross_conn) { /* no cross connection */
^
sound/soc/codecs/wcd-mbhc-v2.c:1192:26: note: Condition 'cross_conn<0'
is always true
} else if (cross_conn < 0) /* Error */
^
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@...ux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@...ux.intel.com>
Reviewed-by: Chao Song <chao.song@...el.com>
---
sound/soc/codecs/wcd-mbhc-v2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/wcd-mbhc-v2.c b/sound/soc/codecs/wcd-mbhc-v2.c
index 98baef594bf31..b16a18dbfe7af 100644
--- a/sound/soc/codecs/wcd-mbhc-v2.c
+++ b/sound/soc/codecs/wcd-mbhc-v2.c
@@ -1189,7 +1189,7 @@ static void wcd_correct_swch_plug(struct work_struct *work)
pt_gnd_mic_swap_cnt = 0;
plug_type = wcd_mbhc_get_plug_from_adc(mbhc, output_mv);
continue;
- } else if (cross_conn < 0) /* Error */
+ } else /* Error if (cross_conn < 0) */
continue;
if (pt_gnd_mic_swap_cnt == GND_MIC_SWAP_THRESHOLD) {
--
2.34.1
Powered by blists - more mailing lists