MLK-11915-09 ASoC: cs42xx8: remove the no effect comparison
authorZidan Wang <zidan.wang@freescale.com>
Fri, 27 Nov 2015 03:22:32 +0000 (11:22 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:18 +0000 (14:49 -0500)
rate_tx and rate_rx are always greater than or equal to 0, so remove the
no effect comparison. Reported by Coverity.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
(cherry picked from commit d5957250784a27cf6f6f421d8a6e0ba45b4bbc18)

sound/soc/codecs/cs42xx8.c

index 599f802..76b1b76 100644 (file)
@@ -264,7 +264,7 @@ static int cs42xx8_hw_params(struct snd_pcm_substream *substream,
                fm_rx = CS42XX8_FM_AUTO;
                fm_tx = CS42XX8_FM_AUTO;
        } else {
-               if (rate_tx >= 0 && rate_tx < 50000)
+               if (rate_tx < 50000)
                        fm_tx = CS42XX8_FM_SINGLE;
                else if (rate_tx > 50000 && rate_tx < 100000)
                        fm_tx = CS42XX8_FM_DOUBLE;
@@ -275,7 +275,7 @@ static int cs42xx8_hw_params(struct snd_pcm_substream *substream,
                        return -EINVAL;
                }
 
-               if (rate_rx >= 0 && rate_rx < 50000)
+               if (rate_rx < 50000)
                        fm_rx = CS42XX8_FM_SINGLE;
                else if (rate_rx > 50000 && rate_rx < 100000)
                        fm_rx = CS42XX8_FM_DOUBLE;