summaryrefslogtreecommitdiffstats
path: root/sound/soc/stm
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2018-10-31 19:31:43 +0000
committerMark Brown <broonie@kernel.org>2018-11-05 10:33:06 +0000
commit6b27e27729270a2478fdebea2db9c4f57bb4e8e6 (patch)
tree82176386781378ef69a7755bb6d32a35e2184fd1 /sound/soc/stm
parent651022382c7f8da46cb4872a545ee1da6d097d2a (diff)
downloadlinux-6b27e27729270a2478fdebea2db9c4f57bb4e8e6.tar.bz2
ASoC: stm32: sai: fix less than zero comparison on unsigned int
Currently, the comparison of div < 0 is always false because div is an unsigned int. Fix this by making div an int. Detected by CoverityScan, CID#1475309 ("Unsigned compared against 0") Fixes: 8307b2afd386 "(ASoC: stm32: sai: set sai as mclk clock provider") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/stm')
-rw-r--r--sound/soc/stm/stm32_sai_sub.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c
index ea05cc91aa05..506423d5861a 100644
--- a/sound/soc/stm/stm32_sai_sub.c
+++ b/sound/soc/stm/stm32_sai_sub.c
@@ -336,8 +336,7 @@ static int stm32_sai_mclk_set_rate(struct clk_hw *hw, unsigned long rate,
{
struct stm32_sai_mclk_data *mclk = to_mclk_data(hw);
struct stm32_sai_sub_data *sai = mclk->sai_data;
- unsigned int div;
- int ret;
+ int div, ret;
div = stm32_sai_get_clk_div(sai, parent_rate, rate);
if (div < 0)