summaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/sdla_fr.c
diff options
context:
space:
mode:
authorMarcelo Feitoza Parisi <marcelo@feitoza.com.br>2005-07-15 09:59:26 -0700
committerDavid S. Miller <davem@davemloft.net>2005-07-15 09:59:26 -0700
commita8178345c4f12f4413e5620fc86a6b0381c41bc9 (patch)
treedd9cb8c953556d539eabd4137032873a6578e988 /drivers/net/wan/sdla_fr.c
parent9d853c3757ef74ded5ae564d68370f22208fb88b (diff)
downloadkernel-crypto-a8178345c4f12f4413e5620fc86a6b0381c41bc9.tar.gz
kernel-crypto-a8178345c4f12f4413e5620fc86a6b0381c41bc9.tar.xz
kernel-crypto-a8178345c4f12f4413e5620fc86a6b0381c41bc9.zip
[WAN]: drivers/net/wan/: use of time_after macro
From: Marcelo Feitoza Parisi <marcelo@feitoza.com.br> 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> Signed-off-by: Domen Puncer <domen@coderock.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wan/sdla_fr.c')
-rw-r--r--drivers/net/wan/sdla_fr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/wan/sdla_fr.c b/drivers/net/wan/sdla_fr.c
index 2efccb0554c..c5f5e62aab8 100644
--- a/drivers/net/wan/sdla_fr.c
+++ b/drivers/net/wan/sdla_fr.c
@@ -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 @@ static int update(struct wan_device* wandev)
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 @@ static void trigger_unconfig_fr(struct net_device *dev)
{
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 @@ static void trigger_unconfig_fr(struct net_device *dev)
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);