[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220822184239.169757-4-pierre-louis.bossart@linux.intel.com>
Date: Mon, 22 Aug 2022 20:42:37 +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 3/5] ASoC: wcd9335: remove always-true condition
cppcheck warning:
sound/soc/codecs/wcd9335.c:1824:22: style: Condition 'tx_port==13' is
always true [knownConditionTrueFalse]
} else if (tx_port == 13) {
^
sound/soc/codecs/wcd9335.c:1802:16: note: Assuming that condition
'tx_port==12' is not redundant
if ((tx_port == 12) || (tx_port >= 14)) {
^
sound/soc/codecs/wcd9335.c:1802:35: note: Assuming that condition
'tx_port>=14' is not redundant
if ((tx_port == 12) || (tx_port >= 14)) {
^
sound/soc/codecs/wcd9335.c:1824:22: note: Condition 'tx_port==13' is
always true
} else if (tx_port == 13) {
^
sound/soc/codecs/wcd9335.c:1845:22: style: Condition 'tx_port==13' is
always true [knownConditionTrueFalse]
} else if (tx_port == 13) {
^
sound/soc/codecs/wcd9335.c:1802:16: note: Assuming that condition
'tx_port==12' is not redundant
if ((tx_port == 12) || (tx_port >= 14)) {
^
sound/soc/codecs/wcd9335.c:1802:35: note: Assuming that condition
'tx_port>=14' is not redundant
if ((tx_port == 12) || (tx_port >= 14)) {
^
sound/soc/codecs/wcd9335.c:1845:22: note: Condition 'tx_port==13' is
always true
} else if (tx_port == 13) {
^
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/wcd9335.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c
index beeeb35e80321..5b4d3c5973532 100644
--- a/sound/soc/codecs/wcd9335.c
+++ b/sound/soc/codecs/wcd9335.c
@@ -1821,12 +1821,10 @@ static int wcd9335_set_decimator_rate(struct snd_soc_dai *dai,
tx_port_reg = WCD9335_CDC_IF_ROUTER_TX_MUX_CFG3;
shift = 0;
shift_val = 0x0F;
- } else if (tx_port == 13) {
+ } else /* (tx_port == 13) */ {
tx_port_reg = WCD9335_CDC_IF_ROUTER_TX_MUX_CFG3;
shift = 4;
shift_val = 0x03;
- } else {
- return -EINVAL;
}
tx_mux_sel = snd_soc_component_read(comp, tx_port_reg) &
--
2.34.1
Powered by blists - more mailing lists