aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuansheng Liu <chuansheng.liu@intel.com>2012-11-06 12:31:37 -0500
committerMarc Kleine-Budde <mkl@pengutronix.de>2012-11-15 11:26:04 -0500
commitc70edb9e8a30c7bd8eae347b9a7d83984e2b5ae3 (patch)
tree7370721b01919de4c7287dbf1a45aa3337e24ecf
parent7653ebd5f6a4cd1976cb82e8ef94ebbe3ff001f3 (diff)
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.c4
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,
1692 return ret; 1692 return ret;
1693 1693
1694 ret = wait_for_completion_timeout(&mod->buserror_comp, HZ); 1694 ret = wait_for_completion_timeout(&mod->buserror_comp, HZ);
1695 if (ret <= 0) { 1695 if (ret == 0) {
1696 dev_info(mod->dev, "%s timed out\n", __func__); 1696 dev_info(mod->dev, "%s timed out\n", __func__);
1697 return -ETIMEDOUT; 1697 return -ETIMEDOUT;
1698 } 1698 }
@@ -1718,7 +1718,7 @@ static ssize_t ican3_sysfs_show_term(struct device *dev,
1718 return ret; 1718 return ret;
1719 1719
1720 ret = wait_for_completion_timeout(&mod->termination_comp, HZ); 1720 ret = wait_for_completion_timeout(&mod->termination_comp, HZ);
1721 if (ret <= 0) { 1721 if (ret == 0) {
1722 dev_info(mod->dev, "%s timed out\n", __func__); 1722 dev_info(mod->dev, "%s timed out\n", __func__);
1723 return -ETIMEDOUT; 1723 return -ETIMEDOUT;
1724 } 1724 }