From: Chuansheng Liu Date: Tue, 6 Nov 2012 17:31:37 +0000 (+0800) Subject: can: janz-ican3: Fix the usage of wait_for_completion_timeout X-Git-Tag: v3.8-rc1~139^2~309^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c70edb9e8a30c7bd8eae347b9a7d83984e2b5ae3;p=platform%2Fkernel%2Flinux-3.10.git can: janz-ican3: Fix the usage of wait_for_completion_timeout 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 Signed-off-by: Marc Kleine-Budde --- diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c index 7edadee..c0bfb0a 100644 --- a/drivers/net/can/janz-ican3.c +++ b/drivers/net/can/janz-ican3.c @@ -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; }