]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
clk: hisilicon: fix warning from smatch
authorZhangfei Gao <zhangfei.gao@linaro.org>
Mon, 10 Mar 2014 03:33:20 +0000 (11:33 +0800)
committerMike Turquette <mturquette@linaro.org>
Fri, 21 Mar 2014 02:05:39 +0000 (19:05 -0700)
drivers/clk/hisilicon/clk-hi3620.c:338
mmc_clk_delay() warn: always true condition '(para >= 0) => (0-u32max >= 0)'

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
drivers/clk/hisilicon/clk-hi3620.c

index 233eba22187a900baf7427f51f5ab7820811e4ed..339945d2503b33798ca4e98b51e140f2b8f658ae 100644 (file)
@@ -326,15 +326,14 @@ static u32 mmc_clk_delay(u32 val, u32 para, u32 off, u32 len)
 {
        u32 i;
 
-       if (para >= 0) {
-               for (i = 0; i < len; i++) {
-                       if (para % 2)
-                               val |= 1 << (off + i);
-                       else
-                               val &= ~(1 << (off + i));
-                       para = para >> 1;
-               }
+       for (i = 0; i < len; i++) {
+               if (para % 2)
+                       val |= 1 << (off + i);
+               else
+                       val &= ~(1 << (off + i));
+               para = para >> 1;
        }
+
        return val;
 }