diff options
author | Marcelo Feitoza Parisi <marcelo@feitoza.com.br> | 2006-01-09 21:37:15 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-01-17 07:59:23 -0500 |
commit | ff5688ae1cedfb175b5ed0f319d03ad2e5ee005d (patch) | |
tree | eca0d41b3eefc833238591e0100a8136f21269a7 /drivers/net/3c523.c | |
parent | e03d72b99e4027504ada134bf1804d6ea792b206 (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/3c523.c')
-rw-r--r-- | drivers/net/3c523.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/3c523.c b/drivers/net/3c523.c index 9e1fe2e0478c..b40885d41680 100644 --- a/drivers/net/3c523.c +++ b/drivers/net/3c523.c | |||
@@ -105,6 +105,7 @@ | |||
105 | #include <linux/mca-legacy.h> | 105 | #include <linux/mca-legacy.h> |
106 | #include <linux/ethtool.h> | 106 | #include <linux/ethtool.h> |
107 | #include <linux/bitops.h> | 107 | #include <linux/bitops.h> |
108 | #include <linux/jiffies.h> | ||
108 | 109 | ||
109 | #include <asm/uaccess.h> | 110 | #include <asm/uaccess.h> |
110 | #include <asm/processor.h> | 111 | #include <asm/processor.h> |
@@ -658,7 +659,7 @@ static int init586(struct net_device *dev) | |||
658 | 659 | ||
659 | s = jiffies; /* warning: only active with interrupts on !! */ | 660 | s = jiffies; /* warning: only active with interrupts on !! */ |
660 | while (!(cfg_cmd->cmd_status & STAT_COMPL)) { | 661 | while (!(cfg_cmd->cmd_status & STAT_COMPL)) { |
661 | if (jiffies - s > 30*HZ/100) | 662 | if (time_after(jiffies, s + 30*HZ/100)) |
662 | break; | 663 | break; |
663 | } | 664 | } |
664 | 665 | ||
@@ -684,7 +685,7 @@ static int init586(struct net_device *dev) | |||
684 | 685 | ||
685 | s = jiffies; | 686 | s = jiffies; |
686 | while (!(ias_cmd->cmd_status & STAT_COMPL)) { | 687 | while (!(ias_cmd->cmd_status & STAT_COMPL)) { |
687 | if (jiffies - s > 30*HZ/100) | 688 | if (time_after(jiffies, s + 30*HZ/100)) |
688 | break; | 689 | break; |
689 | } | 690 | } |
690 | 691 | ||
@@ -709,7 +710,7 @@ static int init586(struct net_device *dev) | |||
709 | 710 | ||
710 | s = jiffies; | 711 | s = jiffies; |
711 | while (!(tdr_cmd->cmd_status & STAT_COMPL)) { | 712 | while (!(tdr_cmd->cmd_status & STAT_COMPL)) { |
712 | if (jiffies - s > 30*HZ/100) { | 713 | if (time_after(jiffies, s + 30*HZ/100)) { |
713 | printk(KERN_WARNING "%s: %d Problems while running the TDR.\n", dev->name, __LINE__); | 714 | printk(KERN_WARNING "%s: %d Problems while running the TDR.\n", dev->name, __LINE__); |
714 | result = 1; | 715 | result = 1; |
715 | break; | 716 | break; |
@@ -798,7 +799,7 @@ static int init586(struct net_device *dev) | |||
798 | elmc_id_attn586(); | 799 | elmc_id_attn586(); |
799 | s = jiffies; | 800 | s = jiffies; |
800 | while (!(mc_cmd->cmd_status & STAT_COMPL)) { | 801 | while (!(mc_cmd->cmd_status & STAT_COMPL)) { |
801 | if (jiffies - s > 30*HZ/100) | 802 | if (time_after(jiffies, s + 30*HZ/100)) |
802 | break; | 803 | break; |
803 | } | 804 | } |
804 | if (!(mc_cmd->cmd_status & STAT_COMPL)) { | 805 | if (!(mc_cmd->cmd_status & STAT_COMPL)) { |