ASoC: rockchip: i2s_tdm: improve return value handling
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Mon, 25 Oct 2021 18:59:33 +0000 (13:59 -0500)
committerMark Brown <broonie@kernel.org>
Wed, 27 Oct 2021 10:31:16 +0000 (11:31 +0100)
cppcheck reports the following warning:

sound/soc/rockchip/rockchip_i2s_tdm.c:599:9: warning: Identical
condition and return expression 'ret', return value is always 0
[identicalConditionAfterEarlyExit]

 return ret;
        ^
sound/soc/rockchip/rockchip_i2s_tdm.c:594:6: note: If condition 'ret'
is true, the function will return/exit
 if (ret)
     ^
sound/soc/rockchip/rockchip_i2s_tdm.c:599:9: note: Returning identical
expression 'ret'

 return ret;
        ^

While the code is not wrong, it's clearer to return 0 directly.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211025185933.144327-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/rockchip/rockchip_i2s_tdm.c

index e8dee1f..17b9b28 100644 (file)
@@ -596,7 +596,7 @@ static int rockchip_i2s_tdm_clk_set_rate(struct rk_i2s_tdm_dev *i2s_tdm,
 
        i2s_tdm->clk_ppm = ppm;
 
-       return ret;
+       return 0;
 }
 
 static int rockchip_i2s_tdm_calibrate_mclk(struct rk_i2s_tdm_dev *i2s_tdm,