mmc: alcor: remove a redundant greater or equal to zero comparison
authorColin Ian King <colin.king@canonical.com>
Mon, 1 Jul 2019 17:52:46 +0000 (18:52 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 10 Jul 2019 11:17:30 +0000 (13:17 +0200)
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>
drivers/mmc/host/alcor.c

index e481535cba2ba90c51056328b2aa34deaf39bba5..1aee485d56d4c4a13b9b899f1e1bba88613ac1cd 100644 (file)
@@ -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;