[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>
This commit is contained in:
Marcelo Feitoza Parisi
2006-01-09 18:37:15 -08:00
committed by Jeff Garzik
parent e03d72b99e
commit ff5688ae1c
22 changed files with 65 additions and 45 deletions

View File

@ -105,6 +105,7 @@
#include <linux/mca-legacy.h>
#include <linux/ethtool.h>
#include <linux/bitops.h>
#include <linux/jiffies.h>
#include <asm/uaccess.h>
#include <asm/processor.h>
@ -658,7 +659,7 @@ static int init586(struct net_device *dev)
s = jiffies; /* warning: only active with interrupts on !! */
while (!(cfg_cmd->cmd_status & STAT_COMPL)) {
if (jiffies - s > 30*HZ/100)
if (time_after(jiffies, s + 30*HZ/100))
break;
}
@ -684,7 +685,7 @@ static int init586(struct net_device *dev)
s = jiffies;
while (!(ias_cmd->cmd_status & STAT_COMPL)) {
if (jiffies - s > 30*HZ/100)
if (time_after(jiffies, s + 30*HZ/100))
break;
}
@ -709,7 +710,7 @@ static int init586(struct net_device *dev)
s = jiffies;
while (!(tdr_cmd->cmd_status & STAT_COMPL)) {
if (jiffies - s > 30*HZ/100) {
if (time_after(jiffies, s + 30*HZ/100)) {
printk(KERN_WARNING "%s: %d Problems while running the TDR.\n", dev->name, __LINE__);
result = 1;
break;
@ -798,7 +799,7 @@ static int init586(struct net_device *dev)
elmc_id_attn586();
s = jiffies;
while (!(mc_cmd->cmd_status & STAT_COMPL)) {
if (jiffies - s > 30*HZ/100)
if (time_after(jiffies, s + 30*HZ/100))
break;
}
if (!(mc_cmd->cmd_status & STAT_COMPL)) {