can: janz-ican3: Fix the usage of wait_for_completion_timeout
authorChuansheng Liu <chuansheng.liu@intel.com>
Tue, 6 Nov 2012 17:31:37 +0000 (01:31 +0800)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 15 Nov 2012 16:26:04 +0000 (17:26 +0100)
The return value of wait_for_completion_timeout() is always
>= 0 with unsigned int type.

So the condition "ret < 0" or "ret >= 0" is pointless.

Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/janz-ican3.c

index 7edadee487bab16c0cbcf514ab59540f35cc2a41..c0bfb0ad3e0d5c9b327452c638ed81103e2a6f1b 100644 (file)
@@ -1692,7 +1692,7 @@ static int ican3_get_berr_counter(const struct net_device *ndev,
                return ret;
 
        ret = wait_for_completion_timeout(&mod->buserror_comp, HZ);
-       if (ret <= 0) {
+       if (ret == 0) {
                dev_info(mod->dev, "%s timed out\n", __func__);
                return -ETIMEDOUT;
        }
@@ -1718,7 +1718,7 @@ static ssize_t ican3_sysfs_show_term(struct device *dev,
                return ret;
 
        ret = wait_for_completion_timeout(&mod->termination_comp, HZ);
-       if (ret <= 0) {
+       if (ret == 0) {
                dev_info(mod->dev, "%s timed out\n", __func__);
                return -ETIMEDOUT;
        }
This page took 0.034215 seconds and 5 git commands to generate.