public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] newport: newport_*wait() return 0 on timeout
@ 2009-01-31 15:29 Roel Kluin
  2009-02-02 12:08 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 5+ messages in thread
From: Roel Kluin @ 2009-01-31 15:29 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: video4linux-list, linux-media

With a postfix decrement t reaches -1 on timeout which results in a
return of 0.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/include/video/newport.h b/include/video/newport.h
index 1f5ebea..001b935 100644
--- a/include/video/newport.h
+++ b/include/video/newport.h
@@ -453,7 +453,7 @@ static __inline__ int newport_wait(struct newport_regs *regs)
 {
 	int t = BUSY_TIMEOUT;
 
-	while (t--)
+	while (--t)
 		if (!(regs->cset.status & NPORT_STAT_GBUSY))
 			break;
 	return !t;
@@ -463,7 +463,7 @@ static __inline__ int newport_bfwait(struct newport_regs *regs)
 {
 	int t = BUSY_TIMEOUT;
 
-	while (t--)
+	while (--t)
 		if(!(regs->cset.status & NPORT_STAT_BBUSY))
 			break;
 	return !t;

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

end of thread, other threads:[~2009-02-02 16:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-31 15:29 [PATCH] newport: newport_*wait() return 0 on timeout Roel Kluin
2009-02-02 12:08 ` Mauro Carvalho Chehab
2009-02-02 13:32   ` roel kluin
2009-02-02 16:04     ` Randy Dunlap
2009-02-02 16:09     ` Mauro Carvalho Chehab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox