summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2019-07-01 19:52:46 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2019-07-10 13:17:30 +0200
commit42248a918d7c18a535b08f05badb988b140298f6 (patch)
tree7391c3def2f8f4c5954e7486d63ce9f2bb3ebbed /drivers/mmc
parentmmc: sdhci-msm: fix mutex while in spinlock (diff)
downloadlinux-42248a918d7c18a535b08f05badb988b140298f6.tar.xz
linux-42248a918d7c18a535b08f05badb988b140298f6.zip
mmc: alcor: remove a redundant greater or equal to zero comparison
A greater or equal comparison on the unsigned int variable tmp_diff is always true as unsigned ints are never negative. Hence the comparison is redundant and can be removed. Addresses-Coverity: ("Unsigned compared against 0") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/alcor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mmc/host/alcor.c b/drivers/mmc/host/alcor.c
index e481535cba2b..1aee485d56d4 100644
--- a/drivers/mmc/host/alcor.c
+++ b/drivers/mmc/host/alcor.c
@@ -672,7 +672,7 @@ static void alcor_set_clock(struct alcor_sdmmc_host *host, unsigned int clock)
tmp_clock = DIV_ROUND_UP(cfg->clk_src_freq, tmp_div);
tmp_diff = abs(clock - tmp_clock);
- if (tmp_diff >= 0 && tmp_diff < diff) {
+ if (tmp_diff < diff) {
diff = tmp_diff;
clk_src = cfg->clk_src_reg;
clk_div = tmp_div;