Unverified Commit 0016361d authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown
Browse files

ASoC: wcd9335: remove redundant tests



cppcheck warning:

sound/soc/codecs/wcd9335.c:1810:23: style: Condition 'tx_port>=4' is
always true [knownConditionTrueFalse]
  } else if ((tx_port >= 4) && (tx_port < 8)) {
                      ^

sound/soc/codecs/wcd9335.c:1806:15: note: Assuming that condition
'tx_port<4' is not redundant
  if (tx_port < 4) {
              ^
sound/soc/codecs/wcd9335.c:1810:23: note: Condition 'tx_port>=4' is
always true
  } else if ((tx_port >= 4) && (tx_port < 8)) {
                      ^

Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220520211719.607543-5-pierre-louis.bossart@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent cac24a36
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1807,11 +1807,11 @@ static int wcd9335_set_decimator_rate(struct snd_soc_dai *dai,
			tx_port_reg = WCD9335_CDC_IF_ROUTER_TX_MUX_CFG0;
			shift = (tx_port << 1);
			shift_val = 0x03;
		} else if ((tx_port >= 4) && (tx_port < 8)) {
		} else if (tx_port < 8) {
			tx_port_reg = WCD9335_CDC_IF_ROUTER_TX_MUX_CFG1;
			shift = ((tx_port - 4) << 1);
			shift_val = 0x03;
		} else if ((tx_port >= 8) && (tx_port < 11)) {
		} else if (tx_port < 11) {
			tx_port_reg = WCD9335_CDC_IF_ROUTER_TX_MUX_CFG2;
			shift = ((tx_port - 8) << 1);
			shift_val = 0x03;