All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH] drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c :
@ 2005-07-16  7:07 Marcelo Feitoza Parisi
  0 siblings, 0 replies; only message in thread
From: Marcelo Feitoza Parisi @ 2005-07-16  7:07 UTC (permalink / raw)
  To: kernel-janitors

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



[-- Attachment #2: dvb-ttusb-budget.patch --]
[-- Type: text/x-patch, Size: 1123 bytes --]

Use of the time_after_eq() 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/ttusb-budget/dvb-ttusb-budget.c	2005-07-13 17:52:17.000000000 -0300
+++ linux-kj/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c	2005-07-15 21:46:29.050584920 -0300
@@ -18,6 +18,7 @@
 #include <linux/delay.h>
 #include <linux/time.h>
 #include <linux/errno.h>
+#include <linux/jiffies.h>
 #include <asm/semaphore.h>
 
 #include "dvb_frontend.h"
@@ -570,7 +571,8 @@
 				  const u8 * data, int len);
 #endif
 
-static int numpkt = 0, lastj, numts, numstuff, numsec, numinvalid;
+static int numpkt = 0, numts, numstuff, numsec, numinvalid;
+static unsigned long lastj;
 
 static void ttusb_process_muxpack(struct ttusb *ttusb, const u8 * muxpack,
 			   int len)
@@ -779,7 +781,7 @@
 			u8 *data;
 			int len;
 			numpkt++;
-			if ((jiffies - lastj) >= HZ) {
+			if (time_after_eq(jiffies, lastj + HZ)) {
 #if DEBUG > 2
 				printk
 				    ("frames/s: %d (ts: %d, stuff %d, sec: %d, invalid: %d, all: %d)\n",

[-- 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] only message in thread

only message in thread, other threads:[~2005-07-16  7:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-16  7:07 [KJ] [PATCH] drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.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.