All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de, "Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>,
	broonie@kernel.org, "Bard Liao" <yung-chuan.liao@linux.intel.com>,
	"Pierre-Louis Bossart" <pierre-louis.bossart@linux.intel.com>
Subject: [PATCH 04/16] ASoC: wcd9335: remove redundant tests
Date: Fri, 20 May 2022 16:17:07 -0500	[thread overview]
Message-ID: <20220520211719.607543-5-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20220520211719.607543-1-pierre-louis.bossart@linux.intel.com>

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: 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>
---
 sound/soc/codecs/wcd9335.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c
index 617a36a89dfed..e1b6930480842 100644
--- a/sound/soc/codecs/wcd9335.c
+++ b/sound/soc/codecs/wcd9335.c
@@ -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;
-- 
2.30.2


  parent reply	other threads:[~2022-05-20 21:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-20 21:17 [PATCH 00/16] ASoC: trivial changes for cppcheck warnings Pierre-Louis Bossart
2022-05-20 21:17 ` [PATCH 01/16] ASoC: cs35l45: typo in argument definition Pierre-Louis Bossart
2022-05-20 21:17 ` [PATCH 02/16] ASoC: cs42l42: remove redundant test Pierre-Louis Bossart
2022-05-20 21:17 ` [PATCH 03/16] ASoC: wcd-mbhc-v2: remove useless initialization Pierre-Louis Bossart
2022-05-20 21:17 ` Pierre-Louis Bossart [this message]
2022-05-20 21:17 ` [PATCH 05/16] ASoC: Intel: atom: sst: " Pierre-Louis Bossart
2022-05-20 21:17 ` [PATCH 06/16] ASoC: Intel: atom: sst_ipc: remove redundant test Pierre-Louis Bossart
2022-05-20 21:17 ` [PATCH 07/16] ASoC: Intel: atom: sst_ipc: remove useless initializations Pierre-Louis Bossart
2022-05-20 21:17 ` [PATCH 08/16] ASoC: Intel: atom: controls: " Pierre-Louis Bossart
2022-05-20 21:17 ` [PATCH 09/16] ASoC: Intel: boards: reset acpi_chan_package Pierre-Louis Bossart
2022-05-20 21:17 ` [PATCH 10/16] ASoC: Intel: sof_pcm512x: remove unnecessary init Pierre-Louis Bossart
2022-05-20 21:17 ` [PATCH 11/16] ASoC: mediatek: mt8195: simplify error handling Pierre-Louis Bossart
2022-05-20 21:17 ` [PATCH 12/16] ASoC: qcom: q6dsp: q6adm: remove useless initializations Pierre-Louis Bossart
2022-05-20 21:17 ` [PATCH 13/16] ASoC: qcom: q6dsp: remove spurious space Pierre-Louis Bossart
2022-05-20 21:17 ` [PATCH 14/16] ASoC: rockchip: simplify error handling Pierre-Louis Bossart
2022-05-20 21:17 ` [PATCH 15/16] ASoC: samsung: snow: " Pierre-Louis Bossart
2022-05-20 21:17 ` [PATCH 16/16] ASoC: meson: remove useless initialization Pierre-Louis Bossart
2022-06-07 10:55 ` [PATCH 00/16] ASoC: trivial changes for cppcheck warnings Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220520211719.607543-5-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=tiwai@suse.de \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.