aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/tokenring/olympic.c
diff options
context:
space:
mode:
authorMarcelo Feitoza Parisi <marcelo@feitoza.com.br>2006-01-09 18:37:15 -0800
committerJeff Garzik <jgarzik@pobox.com>2006-01-17 07:59:23 -0500
commitff5688ae1cedfb175b5ed0f319d03ad2e5ee005d (patch)
treeeca0d41b3eefc833238591e0100a8136f21269a7 /drivers/net/tokenring/olympic.c
parente03d72b99e4027504ada134bf1804d6ea792b206 (diff)
[PATCH] drivers/net/*: use time_after() and friends
They deal with wrapping correctly and are nicer to read. Also make jiffies-holding variables unsigned long. Signed-off-by: Marcelo Feitoza Parisi <marcelo@feitoza.com.br> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/tokenring/olympic.c')
-rw-r--r--drivers/net/tokenring/olympic.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c
index 05477d24fd4..23032a7bc0a 100644
--- a/drivers/net/tokenring/olympic.c
+++ b/drivers/net/tokenring/olympic.c
@@ -100,6 +100,7 @@
#include <linux/pci.h>
#include <linux/spinlock.h>
#include <linux/bitops.h>
+#include <linux/jiffies.h>
#include <net/checksum.h>
@@ -307,7 +308,7 @@ static int __devinit olympic_init(struct net_device *dev)
t=jiffies;
while((readl(olympic_mmio+BCTL)) & BCTL_SOFTRESET) {
schedule();
- if(jiffies-t > 40*HZ) {
+ if(time_after(jiffies, t + 40*HZ)) {
printk(KERN_ERR "IBM PCI tokenring card not responding.\n");
return -ENODEV;
}
@@ -359,7 +360,7 @@ static int __devinit olympic_init(struct net_device *dev)
t=jiffies;
while (!readl(olympic_mmio+CLKCTL) & CLKCTL_PAUSE) {
schedule() ;
- if(jiffies-t > 2*HZ) {
+ if(time_after(jiffies, t + 2*HZ)) {
printk(KERN_ERR "IBM Cardbus tokenring adapter not responsing.\n") ;
return -ENODEV;
}
@@ -373,7 +374,7 @@ static int __devinit olympic_init(struct net_device *dev)
t=jiffies;
while(!((readl(olympic_mmio+SISR_RR)) & SISR_SRB_REPLY)) {
schedule();
- if(jiffies-t > 15*HZ) {
+ if(time_after(jiffies, t + 15*HZ)) {
printk(KERN_ERR "IBM PCI tokenring card not responding.\n");
return -ENODEV;
}
@@ -519,7 +520,7 @@ static int olympic_open(struct net_device *dev)
olympic_priv->srb_queued=0;
break;
}
- if ((jiffies-t) > 10*HZ) {
+ if (time_after(jiffies, t + 10*HZ)) {
printk(KERN_WARNING "%s: SRB timed out. \n",dev->name) ;
olympic_priv->srb_queued=0;
break ;