diff options
author | Chuansheng Liu <chuansheng.liu@intel.com> | 2012-11-07 01:31:37 +0800 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2012-11-15 17:26:04 +0100 |
commit | c70edb9e8a30c7bd8eae347b9a7d83984e2b5ae3 (patch) | |
tree | 7370721b01919de4c7287dbf1a45aa3337e24ecf | |
parent | 7653ebd5f6a4cd1976cb82e8ef94ebbe3ff001f3 (diff) | |
download | lwn-c70edb9e8a30c7bd8eae347b9a7d83984e2b5ae3.tar.gz lwn-c70edb9e8a30c7bd8eae347b9a7d83984e2b5ae3.zip |
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 <chuansheng.liu@intel.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rw-r--r-- | drivers/net/can/janz-ican3.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c index 7edadee487ba..c0bfb0ad3e0d 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; } |