* [KJ] [PATCH] drivers/net/wan/sdla_fr.c : use of time_after macro
@ 2005-07-11 19:22 Marcelo Feitoza Parisi
0 siblings, 0 replies; only message in thread
From: Marcelo Feitoza Parisi @ 2005-07-11 19:22 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: sdla_fr.patch --]
[-- Type: text/x-patch, Size: 1439 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/net/wan/sdla_fr.c 2005-06-17 16:48:29.000000000 -0300
+++ linux-kj/drivers/net/wan/sdla_fr.c 2005-07-11 16:18:19.120095296 -0300
@@ -152,6 +152,7 @@
#include <asm/io.h> /* for inb(), outb(), etc. */
#include <linux/time.h> /* for do_gettimeofday */
#include <linux/in.h> /* sockaddr_in */
+#include <linux/jiffies.h> /* time_after() macro */
#include <asm/errno.h>
#include <linux/ip.h>
@@ -773,7 +774,7 @@
for(;;) {
if(card->u.f.update_comms_stats == 0)
break;
- if ((jiffies - timeout) > (1 * HZ)){
+ if (time_after(jiffies, timeout + 1 * HZ)){
card->u.f.update_comms_stats = 0;
return -EAGAIN;
}
@@ -4799,7 +4800,7 @@
{
fr_channel_t *chan = dev->priv;
volatile sdla_t *card = chan->card;
- u32 timeout;
+ unsigned long timeout;
fr508_flags_t* flags = card->flags;
int reset_critical=0;
@@ -4821,7 +4822,7 @@
if(!(card->u.f.timer_int_enabled & TMR_INT_ENABLED_UNCONFIG))
break;
- if ((jiffies - timeout) > (1 * HZ)){
+ if (time_after(jiffies, timeout + 1 * HZ)){
card->u.f.timer_int_enabled &= ~TMR_INT_ENABLED_UNCONFIG;
printk(KERN_INFO "%s: Failed to delete DLCI %i\n",
card->devname,chan->dlci);
[-- 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-11 19:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-11 19:22 [KJ] [PATCH] drivers/net/wan/sdla_fr.c : use of time_after macro 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.