Commit c70edb9e authored by Chuansheng Liu's avatar Chuansheng Liu Committed by Marc Kleine-Budde

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: default avatarliu chuansheng <chuansheng.liu@intel.com>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 7653ebd5
...@@ -1692,7 +1692,7 @@ static int ican3_get_berr_counter(const struct net_device *ndev, ...@@ -1692,7 +1692,7 @@ static int ican3_get_berr_counter(const struct net_device *ndev,
return ret; return ret;
ret = wait_for_completion_timeout(&mod->buserror_comp, HZ); ret = wait_for_completion_timeout(&mod->buserror_comp, HZ);
if (ret <= 0) { if (ret == 0) {
dev_info(mod->dev, "%s timed out\n", __func__); dev_info(mod->dev, "%s timed out\n", __func__);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
...@@ -1718,7 +1718,7 @@ static ssize_t ican3_sysfs_show_term(struct device *dev, ...@@ -1718,7 +1718,7 @@ static ssize_t ican3_sysfs_show_term(struct device *dev,
return ret; return ret;
ret = wait_for_completion_timeout(&mod->termination_comp, HZ); ret = wait_for_completion_timeout(&mod->termination_comp, HZ);
if (ret <= 0) { if (ret == 0) {
dev_info(mod->dev, "%s timed out\n", __func__); dev_info(mod->dev, "%s timed out\n", __func__);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment