* [PATCH 1/7] I2c-nomadik: Fix the usage of wait_for_completion_timeout
@ 2012-11-06 17:18 Chuansheng Liu
2012-11-06 17:21 ` [PATCH 2/7] OMAPDSS: DISPC: " Chuansheng Liu
` (2 more replies)
0 siblings, 3 replies; 20+ messages in thread
From: Chuansheng Liu @ 2012-11-06 17:18 UTC (permalink / raw)
To: linus.walleij, w.sang; +Cc: linux-arm-kernel, linux-kernel, chuansheng.liu
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>
---
drivers/i2c/busses/i2c-nomadik.c | 14 --------------
1 files changed, 0 insertions(+), 14 deletions(-)
diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c
index 02c3115..8b2ffcf 100644
--- a/drivers/i2c/busses/i2c-nomadik.c
+++ b/drivers/i2c/busses/i2c-nomadik.c
@@ -435,13 +435,6 @@ static int read_i2c(struct nmk_i2c_dev *dev, u16 flags)
timeout = wait_for_completion_timeout(
&dev->xfer_complete, dev->adap.timeout);
- if (timeout < 0) {
- dev_err(&dev->adev->dev,
- "wait_for_completion_timeout "
- "returned %d waiting for event\n", timeout);
- status = timeout;
- }
-
if (timeout == 0) {
/* Controller timed out */
dev_err(&dev->adev->dev, "read from slave 0x%x timed out\n",
@@ -523,13 +516,6 @@ static int write_i2c(struct nmk_i2c_dev *dev, u16 flags)
timeout = wait_for_completion_timeout(
&dev->xfer_complete, dev->adap.timeout);
- if (timeout < 0) {
- dev_err(&dev->adev->dev,
- "wait_for_completion_timeout "
- "returned %d waiting for event\n", timeout);
- status = timeout;
- }
-
if (timeout == 0) {
/* Controller timed out */
dev_err(&dev->adev->dev, "write to slave 0x%x timed out\n",
--
1.7.0.4
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 2/7] OMAPDSS: DISPC: Fix the usage of wait_for_completion_timeout
2012-11-06 17:18 [PATCH 1/7] I2c-nomadik: Fix the usage of wait_for_completion_timeout Chuansheng Liu
@ 2012-11-06 17:21 ` Chuansheng Liu
2012-11-06 11:30 ` Tomi Valkeinen
2012-11-06 17:22 ` [PATCH 3/7] OMAPDSS: APPLY: " Chuansheng Liu
2012-11-12 17:26 ` [PATCH 1/7] I2c-nomadik: " Wolfram Sang
[not found] ` <CACRpkdYekQF5111NSNSPeaHdxgS_gpXkCjqT1n-n1_iAdDXbSg@mail.gmail.com>
2 siblings, 2 replies; 20+ messages in thread
From: Chuansheng Liu @ 2012-11-06 17:21 UTC (permalink / raw)
To: FlorianSchandinat, tomi.valkeinen; +Cc: linux-kernel, chuansheng.liu
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>
---
drivers/video/omap2/dss/dispc.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index b43477a..9858869 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3893,9 +3893,6 @@ int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout)
if (timeout == 0)
return -ETIMEDOUT;
- if (timeout == -ERESTARTSYS)
- return -ERESTARTSYS;
-
return 0;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH 2/7] OMAPDSS: DISPC: Fix the usage of wait_for_completion_timeout
2012-11-06 17:21 ` [PATCH 2/7] OMAPDSS: DISPC: " Chuansheng Liu
@ 2012-11-06 11:30 ` Tomi Valkeinen
2012-11-06 17:22 ` [PATCH 3/7] OMAPDSS: APPLY: " Chuansheng Liu
1 sibling, 0 replies; 20+ messages in thread
From: Tomi Valkeinen @ 2012-11-06 11:30 UTC (permalink / raw)
To: Chuansheng Liu; +Cc: FlorianSchandinat, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 896 bytes --]
On 2012-11-06 19:21, Chuansheng Liu wrote:
>
> 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>
> ---
> drivers/video/omap2/dss/dispc.c | 3 ---
> 1 files changed, 0 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
> index b43477a..9858869 100644
> --- a/drivers/video/omap2/dss/dispc.c
> +++ b/drivers/video/omap2/dss/dispc.c
> @@ -3893,9 +3893,6 @@ int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout)
> if (timeout == 0)
> return -ETIMEDOUT;
>
> - if (timeout == -ERESTARTSYS)
> - return -ERESTARTSYS;
> -
> return 0;
> }
Thanks. I'll apply this to omapdss tree to avoid any conflicts.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 897 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 3/7] OMAPDSS: APPLY: Fix the usage of wait_for_completion_timeout
2012-11-06 17:21 ` [PATCH 2/7] OMAPDSS: DISPC: " Chuansheng Liu
2012-11-06 11:30 ` Tomi Valkeinen
@ 2012-11-06 17:22 ` Chuansheng Liu
2012-11-06 11:31 ` Tomi Valkeinen
2012-11-06 17:28 ` [PATCH 4/7] wlcore: " Chuansheng Liu
1 sibling, 2 replies; 20+ messages in thread
From: Chuansheng Liu @ 2012-11-06 17:22 UTC (permalink / raw)
To: FlorianSchandinat, tomi.valkeinen; +Cc: linux-kernel, chuansheng.liu
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>
---
drivers/video/omap2/dss/apply.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index 19d66f4..ec42a6a 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -414,8 +414,6 @@ static void wait_pending_extra_info_updates(void)
r = wait_for_completion_timeout(&extra_updated_completion, t);
if (r == 0)
DSSWARN("timeout in wait_pending_extra_info_updates\n");
- else if (r < 0)
- DSSERR("wait_pending_extra_info_updates failed: %d\n", r);
}
int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH 3/7] OMAPDSS: APPLY: Fix the usage of wait_for_completion_timeout
2012-11-06 17:22 ` [PATCH 3/7] OMAPDSS: APPLY: " Chuansheng Liu
@ 2012-11-06 11:31 ` Tomi Valkeinen
2012-11-06 17:28 ` [PATCH 4/7] wlcore: " Chuansheng Liu
1 sibling, 0 replies; 20+ messages in thread
From: Tomi Valkeinen @ 2012-11-06 11:31 UTC (permalink / raw)
To: Chuansheng Liu; +Cc: FlorianSchandinat, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1040 bytes --]
On 2012-11-06 19:22, Chuansheng Liu wrote:
>
> 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>
> ---
> drivers/video/omap2/dss/apply.c | 2 --
> 1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
> index 19d66f4..ec42a6a 100644
> --- a/drivers/video/omap2/dss/apply.c
> +++ b/drivers/video/omap2/dss/apply.c
> @@ -414,8 +414,6 @@ static void wait_pending_extra_info_updates(void)
> r = wait_for_completion_timeout(&extra_updated_completion, t);
> if (r == 0)
> DSSWARN("timeout in wait_pending_extra_info_updates\n");
> - else if (r < 0)
> - DSSERR("wait_pending_extra_info_updates failed: %d\n", r);
> }
>
> int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr)
Thanks. I'll apply this to omapdss tree to avoid any conflicts.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 897 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 4/7] wlcore: Fix the usage of wait_for_completion_timeout
2012-11-06 17:22 ` [PATCH 3/7] OMAPDSS: APPLY: " Chuansheng Liu
2012-11-06 11:31 ` Tomi Valkeinen
@ 2012-11-06 17:28 ` Chuansheng Liu
2012-11-06 17:31 ` [PATCH 5/7] can: janz-ican3: " Chuansheng Liu
2012-11-16 18:23 ` [PATCH 4/7] wlcore: " Luciano Coelho
1 sibling, 2 replies; 20+ messages in thread
From: Chuansheng Liu @ 2012-11-06 17:28 UTC (permalink / raw)
To: luca, eliad; +Cc: linux-kernel, chuansheng.liu
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>
---
drivers/net/wireless/ti/wlcore/ps.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ti/wlcore/ps.c b/drivers/net/wireless/ti/wlcore/ps.c
index 4d1414a..ffcd843 100644
--- a/drivers/net/wireless/ti/wlcore/ps.c
+++ b/drivers/net/wireless/ti/wlcore/ps.c
@@ -151,9 +151,6 @@ int wl1271_ps_elp_wakeup(struct wl1271 *wl)
wl12xx_queue_recovery_work(wl);
ret = -ETIMEDOUT;
goto err;
- } else if (ret < 0) {
- wl1271_error("ELP wakeup completion error.");
- goto err;
}
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 5/7] can: janz-ican3: Fix the usage of wait_for_completion_timeout
2012-11-06 17:28 ` [PATCH 4/7] wlcore: " Chuansheng Liu
@ 2012-11-06 17:31 ` Chuansheng Liu
2012-11-06 11:43 ` Marc Kleine-Budde
2012-11-06 17:33 ` [PATCH 6/7] mx3fb: " Chuansheng Liu
2012-11-16 18:23 ` [PATCH 4/7] wlcore: " Luciano Coelho
1 sibling, 2 replies; 20+ messages in thread
From: Chuansheng Liu @ 2012-11-06 17:31 UTC (permalink / raw)
To: wg, mkl; +Cc: linux-kernel, chuansheng.liu
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>
---
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 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;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH 5/7] can: janz-ican3: Fix the usage of wait_for_completion_timeout
2012-11-06 17:31 ` [PATCH 5/7] can: janz-ican3: " Chuansheng Liu
@ 2012-11-06 11:43 ` Marc Kleine-Budde
2012-11-06 17:33 ` [PATCH 6/7] mx3fb: " Chuansheng Liu
1 sibling, 0 replies; 20+ messages in thread
From: Marc Kleine-Budde @ 2012-11-06 11:43 UTC (permalink / raw)
To: Chuansheng Liu; +Cc: wg, linux-kernel, linux-can
[-- Attachment #1: Type: text/plain, Size: 651 bytes --]
On 11/06/2012 06:31 PM, Chuansheng Liu wrote:
>
> 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>
Thnx, applied to can-next. Please put linux-can@vger.kernel.org on Cc
next time.
regards, Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 6/7] mx3fb: Fix the usage of wait_for_completion_timeout
2012-11-06 17:31 ` [PATCH 5/7] can: janz-ican3: " Chuansheng Liu
2012-11-06 11:43 ` Marc Kleine-Budde
@ 2012-11-06 17:33 ` Chuansheng Liu
2012-11-06 17:36 ` [PATCH 7/7] IB/srpt: " Chuansheng Liu
1 sibling, 1 reply; 20+ messages in thread
From: Chuansheng Liu @ 2012-11-06 17:33 UTC (permalink / raw)
To: FlorianSchandinat; +Cc: linux-kernel, chuansheng.liu
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>
---
drivers/video/mx3fb.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
index ce1d452..88bf368 100644
--- a/drivers/video/mx3fb.c
+++ b/drivers/video/mx3fb.c
@@ -1110,12 +1110,11 @@ static int mx3fb_pan_display(struct fb_var_screeninfo *var,
enable_irq(mx3_fbi->idmac_channel->eof_irq);
ret = wait_for_completion_timeout(&mx3_fbi->flip_cmpl, HZ / 10);
- if (ret <= 0) {
+ if (ret == 0) {
mutex_unlock(&mx3_fbi->mutex);
- dev_info(fbi->device, "Panning failed due to %s\n", ret < 0 ?
- "user interrupt" : "timeout");
+ dev_info(fbi->device, "Panning failed due to timeout\n");
disable_irq(mx3_fbi->idmac_channel->eof_irq);
- return ret ? : -ETIMEDOUT;
+ return -ETIMEDOUT;
}
mx3_fbi->cur_ipu_buf = !mx3_fbi->cur_ipu_buf;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 7/7] IB/srpt: Fix the usage of wait_for_completion_timeout
2012-11-06 17:33 ` [PATCH 6/7] mx3fb: " Chuansheng Liu
@ 2012-11-06 17:36 ` Chuansheng Liu
0 siblings, 0 replies; 20+ messages in thread
From: Chuansheng Liu @ 2012-11-06 17:36 UTC (permalink / raw)
To: nab, roland; +Cc: linux-kernel, chuansheng.liu
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>
---
drivers/infiniband/ulp/srpt/ib_srpt.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index cf23c46..1879b47 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -3527,7 +3527,7 @@ static void srpt_close_session(struct se_session *se_sess)
spin_unlock_irq(&sdev->spinlock);
res = wait_for_completion_timeout(&release_done, 60 * HZ);
- WARN_ON(res <= 0);
+ WARN_ON(res == 0);
}
/**
--
1.7.0.4
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH 4/7] wlcore: Fix the usage of wait_for_completion_timeout
2012-11-06 17:28 ` [PATCH 4/7] wlcore: " Chuansheng Liu
2012-11-06 17:31 ` [PATCH 5/7] can: janz-ican3: " Chuansheng Liu
@ 2012-11-16 18:23 ` Luciano Coelho
1 sibling, 0 replies; 20+ messages in thread
From: Luciano Coelho @ 2012-11-16 18:23 UTC (permalink / raw)
To: Chuansheng Liu; +Cc: eliad, linux-kernel
On Wed, 2012-11-07 at 01:28 +0800, Chuansheng Liu wrote:
> 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>
> ---
Applied and pushed via wl12xx.git.
Thank you!
--
Luca.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/7] I2c-nomadik: Fix the usage of wait_for_completion_timeout
2012-11-06 17:18 [PATCH 1/7] I2c-nomadik: Fix the usage of wait_for_completion_timeout Chuansheng Liu
2012-11-06 17:21 ` [PATCH 2/7] OMAPDSS: DISPC: " Chuansheng Liu
@ 2012-11-12 17:26 ` Wolfram Sang
2012-11-13 1:21 ` Liu, Chuansheng
[not found] ` <CACRpkdYekQF5111NSNSPeaHdxgS_gpXkCjqT1n-n1_iAdDXbSg@mail.gmail.com>
2 siblings, 1 reply; 20+ messages in thread
From: Wolfram Sang @ 2012-11-12 17:26 UTC (permalink / raw)
To: Chuansheng Liu; +Cc: linus.walleij, linux-arm-kernel, linux-kernel, linux-i2c
[-- Attachment #1: Type: text/plain, Size: 2127 bytes --]
On Wed, Nov 07, 2012 at 01:18:37AM +0800, Chuansheng Liu wrote:
>
> 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>
You forgot to add the i2c-list, so I nearly overlooked this patch.
Luckily I haven't, so applied to for-next, thanks! Did you use a script
to find all occurences? Would be nice to know. Also, please take care of
the subject line. "I2c" is misspelled.
@Linus: I am not pushing out today, so if you want to add acks or so...
Thanks,
Wolfram
> ---
> drivers/i2c/busses/i2c-nomadik.c | 14 --------------
> 1 files changed, 0 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c
> index 02c3115..8b2ffcf 100644
> --- a/drivers/i2c/busses/i2c-nomadik.c
> +++ b/drivers/i2c/busses/i2c-nomadik.c
> @@ -435,13 +435,6 @@ static int read_i2c(struct nmk_i2c_dev *dev, u16 flags)
> timeout = wait_for_completion_timeout(
> &dev->xfer_complete, dev->adap.timeout);
>
> - if (timeout < 0) {
> - dev_err(&dev->adev->dev,
> - "wait_for_completion_timeout "
> - "returned %d waiting for event\n", timeout);
> - status = timeout;
> - }
> -
> if (timeout == 0) {
> /* Controller timed out */
> dev_err(&dev->adev->dev, "read from slave 0x%x timed out\n",
> @@ -523,13 +516,6 @@ static int write_i2c(struct nmk_i2c_dev *dev, u16 flags)
> timeout = wait_for_completion_timeout(
> &dev->xfer_complete, dev->adap.timeout);
>
> - if (timeout < 0) {
> - dev_err(&dev->adev->dev,
> - "wait_for_completion_timeout "
> - "returned %d waiting for event\n", timeout);
> - status = timeout;
> - }
> -
> if (timeout == 0) {
> /* Controller timed out */
> dev_err(&dev->adev->dev, "write to slave 0x%x timed out\n",
> --
> 1.7.0.4
>
>
>
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* RE: [PATCH 1/7] I2c-nomadik: Fix the usage of wait_for_completion_timeout
2012-11-12 17:26 ` [PATCH 1/7] I2c-nomadik: " Wolfram Sang
@ 2012-11-13 1:21 ` Liu, Chuansheng
2012-11-13 7:58 ` Wolfram Sang
0 siblings, 1 reply; 20+ messages in thread
From: Liu, Chuansheng @ 2012-11-13 1:21 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linus.walleij, linux-arm-kernel, linux-kernel, linux-i2c
> -----Original Message-----
> From: Wolfram Sang [mailto:w.sang@pengutronix.de]
> Sent: Tuesday, November 13, 2012 1:27 AM
> To: Liu, Chuansheng
> Cc: linus.walleij@linaro.org; linux-arm-kernel@lists.infradead.org;
> linux-kernel@vger.kernel.org; linux-i2c@vger.kernel.org
> Subject: Re: [PATCH 1/7] I2c-nomadik: Fix the usage of
> wait_for_completion_timeout
>
> On Wed, Nov 07, 2012 at 01:18:37AM +0800, Chuansheng Liu wrote:
> >
> > 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>
>
> You forgot to add the i2c-list, so I nearly overlooked this patch.
> Luckily I haven't, so applied to for-next, thanks! Did you use a script
> to find all occurences? Would be nice to know. Also, please take care of
> the subject line. "I2c" is misspelled.
Thanks your pointing out. I just manually reviewed the code when found this point.
Would like to try some auto-script but failed:)
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/7] I2c-nomadik: Fix the usage of wait_for_completion_timeout
2012-11-13 1:21 ` Liu, Chuansheng
@ 2012-11-13 7:58 ` Wolfram Sang
2012-11-13 8:00 ` Liu, Chuansheng
0 siblings, 1 reply; 20+ messages in thread
From: Wolfram Sang @ 2012-11-13 7:58 UTC (permalink / raw)
To: Liu, Chuansheng; +Cc: linus.walleij, linux-arm-kernel, linux-kernel, linux-i2c
[-- Attachment #1: Type: text/plain, Size: 350 bytes --]
> Thanks your pointing out. I just manually reviewed the code when found
> this point. Would like to try some auto-script but failed:)
I can suggest 'coccinelle' for that kind of job.
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* RE: [PATCH 1/7] I2c-nomadik: Fix the usage of wait_for_completion_timeout
2012-11-13 7:58 ` Wolfram Sang
@ 2012-11-13 8:00 ` Liu, Chuansheng
0 siblings, 0 replies; 20+ messages in thread
From: Liu, Chuansheng @ 2012-11-13 8:00 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linus.walleij, linux-arm-kernel, linux-kernel, linux-i2c
> -----Original Message-----
> From: Wolfram Sang [mailto:w.sang@pengutronix.de]
> Sent: Tuesday, November 13, 2012 3:58 PM
> To: Liu, Chuansheng
> Cc: linus.walleij@linaro.org; linux-arm-kernel@lists.infradead.org;
> linux-kernel@vger.kernel.org; linux-i2c@vger.kernel.org
> Subject: Re: [PATCH 1/7] I2c-nomadik: Fix the usage of
> wait_for_completion_timeout
>
>
> > Thanks your pointing out. I just manually reviewed the code when found
> > this point. Would like to try some auto-script but failed:)
>
> I can suggest 'coccinelle' for that kind of job.
Thanks, let me try, if possible anyone can give some help?
>
> --
> Pengutronix e.K. | Wolfram Sang
> |
> Industrial Linux Solutions | http://www.pengutronix.de/
> |
^ permalink raw reply [flat|nested] 20+ messages in thread
[parent not found: <CACRpkdYekQF5111NSNSPeaHdxgS_gpXkCjqT1n-n1_iAdDXbSg@mail.gmail.com>]
* Re: Fwd: [PATCH 1/7] I2c-nomadik: Fix the usage of wait_for_completion_timeout
[not found] ` <CACRpkdYekQF5111NSNSPeaHdxgS_gpXkCjqT1n-n1_iAdDXbSg@mail.gmail.com>
@ 2012-11-15 8:49 ` Srinidhi Kasagar
2012-11-15 9:29 ` Wolfram Sang
0 siblings, 1 reply; 20+ messages in thread
From: Srinidhi Kasagar @ 2012-11-15 8:49 UTC (permalink / raw)
To: chuansheng.liu, w.sang
Cc: linus.walleij, linux-arm-kernel, linux-i2c, linux-kernel
[...]
> From: Chuansheng Liu <chuansheng.liu@intel.com>
> Date: Tue, Nov 6, 2012 at 6:18 PM
> Subject: [PATCH 1/7] I2c-nomadik: Fix the usage of wait_for_completion_timeout
> To: linus.walleij@linaro.org, w.sang@pengutronix.de
> Cc: linux-arm-kernel@lists.infradead.org,
> linux-kernel@vger.kernel.org, chuansheng.liu@intel.com
>
>
>
> 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>
> ---
> drivers/i2c/busses/i2c-nomadik.c | 14 --------------
> 1 files changed, 0 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c
> index 02c3115..8b2ffcf 100644
> --- a/drivers/i2c/busses/i2c-nomadik.c
> +++ b/drivers/i2c/busses/i2c-nomadik.c
> @@ -435,13 +435,6 @@ static int read_i2c(struct nmk_i2c_dev *dev, u16 flags)
> timeout = wait_for_completion_timeout(
> &dev->xfer_complete, dev->adap.timeout);
>
> - if (timeout < 0) {
> - dev_err(&dev->adev->dev,
> - "wait_for_completion_timeout "
> - "returned %d waiting for event\n", timeout);
> - status = timeout;
> - }
> -
No, it is wrong. You need to update the status variable in the case of timeout.
It is used further in nmk_i2c_xfer_one. You could perhaps use
if (timeout == 0) {
...and the rest of the code as is
}
regards/srinidhi
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Fwd: [PATCH 1/7] I2c-nomadik: Fix the usage of wait_for_completion_timeout
2012-11-15 8:49 ` Fwd: " Srinidhi Kasagar
@ 2012-11-15 9:29 ` Wolfram Sang
2012-11-15 9:57 ` Srinidhi Kasagar
0 siblings, 1 reply; 20+ messages in thread
From: Wolfram Sang @ 2012-11-15 9:29 UTC (permalink / raw)
To: Srinidhi Kasagar
Cc: chuansheng.liu, linus.walleij, linux-arm-kernel, linux-i2c, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 573 bytes --]
> > - if (timeout < 0) {
> > - dev_err(&dev->adev->dev,
> > - "wait_for_completion_timeout "
> > - "returned %d waiting for event\n", timeout);
> > - status = timeout;
> > - }
> > -
> No, it is wrong. You need to update the status variable in the case of timeout.
Looking at the patch context, such code comes later.
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Fwd: [PATCH 1/7] I2c-nomadik: Fix the usage of wait_for_completion_timeout
2012-11-15 9:29 ` Wolfram Sang
@ 2012-11-15 9:57 ` Srinidhi Kasagar
2012-11-15 10:18 ` Wolfram Sang
0 siblings, 1 reply; 20+ messages in thread
From: Srinidhi Kasagar @ 2012-11-15 9:57 UTC (permalink / raw)
To: Wolfram Sang
Cc: chuansheng.liu, linus.walleij, linux-arm-kernel, linux-i2c, linux-kernel
On Thu, Nov 15, 2012 at 10:29:53 +0100, Wolfram Sang wrote:
>
> > > - if (timeout < 0) {
> > > - dev_err(&dev->adev->dev,
> > > - "wait_for_completion_timeout "
> > > - "returned %d waiting for event\n", timeout);
> > > - status = timeout;
> > > - }
> > > -
> > No, it is wrong. You need to update the status variable in the case of timeout.
>
> Looking at the patch context, such code comes later.
But it causes regressions; without looking at the "later" code, we can't afford merging
this code now.
regards/srinidhi
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Fwd: [PATCH 1/7] I2c-nomadik: Fix the usage of wait_for_completion_timeout
2012-11-15 9:57 ` Srinidhi Kasagar
@ 2012-11-15 10:18 ` Wolfram Sang
2012-11-15 11:18 ` Srinidhi Kasagar
0 siblings, 1 reply; 20+ messages in thread
From: Wolfram Sang @ 2012-11-15 10:18 UTC (permalink / raw)
To: Srinidhi Kasagar
Cc: chuansheng.liu, linus.walleij, linux-arm-kernel, linux-i2c, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 947 bytes --]
On Thu, Nov 15, 2012 at 03:27:42PM +0530, Srinidhi Kasagar wrote:
> On Thu, Nov 15, 2012 at 10:29:53 +0100, Wolfram Sang wrote:
> >
> > > > - if (timeout < 0) {
> > > > - dev_err(&dev->adev->dev,
> > > > - "wait_for_completion_timeout "
> > > > - "returned %d waiting for event\n", timeout);
> > > > - status = timeout;
> > > > - }
> > > > -
> > > No, it is wrong. You need to update the status variable in the case of timeout.
> >
> > Looking at the patch context, such code comes later.
> But it causes regressions; without looking at the "later" code, we can't afford merging
> this code now.
Later as in "a few lines later" not "some time later". Or am I missing
something else?
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Fwd: [PATCH 1/7] I2c-nomadik: Fix the usage of wait_for_completion_timeout
2012-11-15 10:18 ` Wolfram Sang
@ 2012-11-15 11:18 ` Srinidhi Kasagar
0 siblings, 0 replies; 20+ messages in thread
From: Srinidhi Kasagar @ 2012-11-15 11:18 UTC (permalink / raw)
To: Wolfram Sang
Cc: chuansheng.liu, linus.walleij, linux-arm-kernel, linux-i2c, linux-kernel
On Thu, Nov 15, 2012 at 11:18:20 +0100, Wolfram Sang wrote:
> On Thu, Nov 15, 2012 at 03:27:42PM +0530, Srinidhi Kasagar wrote:
> > On Thu, Nov 15, 2012 at 10:29:53 +0100, Wolfram Sang wrote:
> > >
> > > > > - if (timeout < 0) {
> > > > > - dev_err(&dev->adev->dev,
> > > > > - "wait_for_completion_timeout "
> > > > > - "returned %d waiting for event\n", timeout);
> > > > > - status = timeout;
> > > > > - }
> > > > > -
> > > > No, it is wrong. You need to update the status variable in the case of timeout.
> > >
> > > Looking at the patch context, such code comes later.
> > But it causes regressions; without looking at the "later" code, we can't afford merging
> > this code now.
>
> Later as in "a few lines later" not "some time later". Or am I missing
> something else?
I was too fast in reading emails after my short vacation...Sorry.
Acked-by: srinidhi kasagar <srinidhi.kasagar@stericsson.com>
regards/srinidhi
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2012-11-16 18:23 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-06 17:18 [PATCH 1/7] I2c-nomadik: Fix the usage of wait_for_completion_timeout Chuansheng Liu
2012-11-06 17:21 ` [PATCH 2/7] OMAPDSS: DISPC: " Chuansheng Liu
2012-11-06 11:30 ` Tomi Valkeinen
2012-11-06 17:22 ` [PATCH 3/7] OMAPDSS: APPLY: " Chuansheng Liu
2012-11-06 11:31 ` Tomi Valkeinen
2012-11-06 17:28 ` [PATCH 4/7] wlcore: " Chuansheng Liu
2012-11-06 17:31 ` [PATCH 5/7] can: janz-ican3: " Chuansheng Liu
2012-11-06 11:43 ` Marc Kleine-Budde
2012-11-06 17:33 ` [PATCH 6/7] mx3fb: " Chuansheng Liu
2012-11-06 17:36 ` [PATCH 7/7] IB/srpt: " Chuansheng Liu
2012-11-16 18:23 ` [PATCH 4/7] wlcore: " Luciano Coelho
2012-11-12 17:26 ` [PATCH 1/7] I2c-nomadik: " Wolfram Sang
2012-11-13 1:21 ` Liu, Chuansheng
2012-11-13 7:58 ` Wolfram Sang
2012-11-13 8:00 ` Liu, Chuansheng
[not found] ` <CACRpkdYekQF5111NSNSPeaHdxgS_gpXkCjqT1n-n1_iAdDXbSg@mail.gmail.com>
2012-11-15 8:49 ` Fwd: " Srinidhi Kasagar
2012-11-15 9:29 ` Wolfram Sang
2012-11-15 9:57 ` Srinidhi Kasagar
2012-11-15 10:18 ` Wolfram Sang
2012-11-15 11:18 ` Srinidhi Kasagar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).