All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH] drivers/media/dvb/frontends/stv0299.c : Use of the
@ 2005-07-16  7:23 Marcelo Feitoza Parisi
  2005-07-16  7:24 ` [KJ] [PATCH] drivers/media/dvb/frontends/tda8083.c " Marcelo Feitoza Parisi
  0 siblings, 1 reply; 2+ messages in thread
From: Marcelo Feitoza Parisi @ 2005-07-16  7:23 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: stv0299.patch --]
[-- Type: text/x-patch, Size: 1062 bytes --]

Use of the time_after() macro, defined at linux/jiffies.h, which deal
with wrapping correctly and are nicer to read.

Signed-off-by: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>

--- linux/drivers/media/dvb/frontends/stv0299.c	2005-06-17 16:48:29.000000000 -0300
+++ linux-kj/drivers/media/dvb/frontends/stv0299.c	2005-07-15 21:36:14.110070088 -0300
@@ -48,6 +48,7 @@
 #include <linux/moduleparam.h>
 #include <linux/string.h>
 #include <linux/slab.h>
+#include <linux/jiffies.h>
 #include <asm/div64.h>
 
 #include "dvb_frontend.h"
@@ -190,7 +191,7 @@
 	dprintk ("%s\n", __FUNCTION__);
 
 	while (stv0299_readreg(state, 0x0a) & 1) {
-		if (jiffies - start > timeout) {
+		if (time_after(jiffies, start + timeout)) {
 			dprintk ("%s: timeout!!\n", __FUNCTION__);
 			return -ETIMEDOUT;
 		}
@@ -207,7 +208,7 @@
 	dprintk ("%s\n", __FUNCTION__);
 
 	while ((stv0299_readreg(state, 0x0a) & 3) != 2 ) {
-		if (jiffies - start > timeout) {
+		if (time_after(jiffies, start + timeout)) {
 			dprintk ("%s: timeout!!\n", __FUNCTION__);
 			return -ETIMEDOUT;
 		}

[-- Attachment #3: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* [KJ] [PATCH] drivers/media/dvb/frontends/tda8083.c : Use of the
  2005-07-16  7:23 [KJ] [PATCH] drivers/media/dvb/frontends/stv0299.c : Use of the Marcelo Feitoza Parisi
@ 2005-07-16  7:24 ` Marcelo Feitoza Parisi
  0 siblings, 0 replies; 2+ messages in thread
From: Marcelo Feitoza Parisi @ 2005-07-16  7:24 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: tda8083.patch --]
[-- Type: text/x-patch, Size: 756 bytes --]

Use of the time_before() macro, defined at linux/jiffies.h, which deal
with wrapping correctly and are nicer to read.

Signed-off-by: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>

--- linux/drivers/media/dvb/frontends/tda8083.c	2005-06-17 16:48:29.000000000 -0300
+++ linux-kj/drivers/media/dvb/frontends/tda8083.c	2005-07-15 21:41:35.441220328 -0300
@@ -30,6 +30,7 @@
 #include <linux/moduleparam.h>
 #include <linux/string.h>
 #include <linux/slab.h>
+#include <linux/jiffies.h>
 #include "dvb_frontend.h"
 #include "tda8083.h"
 
@@ -172,7 +173,7 @@
 {
 	unsigned long start = jiffies;
 
-	while (jiffies - start < timeout &&
+	while (time_before(jiffies, start + timeout) &&
                !(tda8083_readreg(state, 0x02) & 0x80))
 	{
 		msleep(50);

[-- Attachment #3: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

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

end of thread, other threads:[~2005-07-16  7:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-16  7:23 [KJ] [PATCH] drivers/media/dvb/frontends/stv0299.c : Use of the Marcelo Feitoza Parisi
2005-07-16  7:24 ` [KJ] [PATCH] drivers/media/dvb/frontends/tda8083.c " Marcelo Feitoza Parisi

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.