Commit 4da006c6 authored by Marcelo Feitoza Parisi's avatar Marcelo Feitoza Parisi Committed by Linus Torvalds

[PATCH] dvb: ttusb-budget: use time_after_eq()

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: default avatarMarcelo Feitoza Parisi <marcelo@feitoza.com.br>
Signed-off-by: default avatarDomen Puncer <domen@coderock.org>
Signed-off-by: default avatarJohannes Stezenbach <js@linuxtv.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1ac2854c
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/jiffies.h>
#include <asm/semaphore.h> #include <asm/semaphore.h>
#include "dvb_frontend.h" #include "dvb_frontend.h"
...@@ -570,7 +571,8 @@ static void ttusb_handle_sec_data(struct ttusb_channel *channel, ...@@ -570,7 +571,8 @@ static void ttusb_handle_sec_data(struct ttusb_channel *channel,
const u8 * data, int len); const u8 * data, int len);
#endif #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, static void ttusb_process_muxpack(struct ttusb *ttusb, const u8 * muxpack,
int len) int len)
...@@ -779,7 +781,7 @@ static void ttusb_iso_irq(struct urb *urb, struct pt_regs *ptregs) ...@@ -779,7 +781,7 @@ static void ttusb_iso_irq(struct urb *urb, struct pt_regs *ptregs)
u8 *data; u8 *data;
int len; int len;
numpkt++; numpkt++;
if ((jiffies - lastj) >= HZ) { if (time_after_eq(jiffies, lastj + HZ)) {
#if DEBUG > 2 #if DEBUG > 2
printk printk
("frames/s: %d (ts: %d, stuff %d, sec: %d, invalid: %d, all: %d)\n", ("frames/s: %d (ts: %d, stuff %d, sec: %d, invalid: %d, all: %d)\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment