All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] fix handling of wait_for_completion_timeout result
@ 2014-12-27 12:23 Sedat Dilek
  0 siblings, 0 replies; 2+ messages in thread
From: Sedat Dilek @ 2014-12-27 12:23 UTC (permalink / raw)
  To: Nicholas Mc Guire; +Cc: LKML, linux-next

[ Not sure which persons and MLs you CCed - I am reading LKML offline ]

Hi,

your patch needs some refreshing...

First your Subject... add a subject-prefix like...

$ git format-patch --subject-prefix="next-20141226"

[ The subject-prefix won't be seen if you push out the commit, but is
good for people to see very quickly against WTF-tree you did your
fixing. ]

Your label...

Check the log in [1] to path/to/file2change, this will tell it to you...

$ git log --oneline drivers/i2c/busses/i2c-imx.c

So your label should be better...

i2c: imx: fix handling of wait_for_completion_timeout result

Seems to be a quick hack :-), some typos in your commit-message...

"wati_for_completion_timeout does not return negative values so
"result" handlin here should be simplified to cover the actually
possible cases only."

*wait*_for_completion_timeout
handlin*g*

Hope this encourages you to do a v2.
Have more fun!

- Sedat -


[1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/log/drivers/i2c/busses/i2c-imx.c

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] fix handling of wait_for_completion_timeout result
@ 2014-12-27 11:48 Nicholas Mc Guire
  0 siblings, 0 replies; 2+ messages in thread
From: Nicholas Mc Guire @ 2014-12-27 11:48 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Grant Likely, Rob Herring, Yao Yuan, Fugang Duan, Fabio Estevam,
	Jingoo Han, Kaushal Butala, linux-i2c, linux-kernel, devicetree,
	Nicholas Mc Guire

wati_for_completion_timeout does not return negative values so 
"result" handlin here should be simplified to cover the actually
possible cases only.

patch was only compile tested for imx_v6_v7_defconfig 

patch is against 3.19.0-rc1 -next-20141226

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
---
 drivers/i2c/busses/i2c-imx.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 7f3a9fe..2be7d9d 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -628,9 +628,9 @@ static int i2c_imx_dma_write(struct imx_i2c_struct *i2c_imx,
 	result = wait_for_completion_timeout(
 				&i2c_imx->dma->cmd_complete,
 				msecs_to_jiffies(DMA_TIMEOUT));
-	if (result <= 0) {
+	if (result == 0) {
 		dmaengine_terminate_all(dma->chan_using);
-		return result ?: -ETIMEDOUT;
+		return -ETIMEDOUT;
 	}
 
 	/* Waiting for transfer complete. */
@@ -686,9 +686,9 @@ static int i2c_imx_dma_read(struct imx_i2c_struct *i2c_imx,
 	result = wait_for_completion_timeout(
 				&i2c_imx->dma->cmd_complete,
 				msecs_to_jiffies(DMA_TIMEOUT));
-	if (result <= 0) {
+	if (result == 0) {
 		dmaengine_terminate_all(dma->chan_using);
-		return result ?: -ETIMEDOUT;
+		return -ETIMEDOUT;
 	}
 
 	/* waiting for transfer complete. */
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-12-27 12:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-27 12:23 [PATCH] fix handling of wait_for_completion_timeout result Sedat Dilek
  -- strict thread matches above, loose matches on Subject: below --
2014-12-27 11:48 Nicholas Mc Guire

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.