[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:
committed by
Jeff Garzik
parent
e03d72b99e
commit
ff5688ae1c
@@ -116,6 +116,7 @@
|
||||
#include <linux/timer.h>
|
||||
#include <linux/if_vlan.h>
|
||||
#include <linux/rtnetlink.h>
|
||||
#include <linux/jiffies.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/uaccess.h>
|
||||
@@ -1607,7 +1608,7 @@ static void ns83820_run_bist(struct net_device *ndev, const char *name, u32 enab
|
||||
{
|
||||
struct ns83820 *dev = PRIV(ndev);
|
||||
int timed_out = 0;
|
||||
long start;
|
||||
unsigned long start;
|
||||
u32 status;
|
||||
int loops = 0;
|
||||
|
||||
@@ -1625,7 +1626,7 @@ static void ns83820_run_bist(struct net_device *ndev, const char *name, u32 enab
|
||||
break;
|
||||
if (status & fail)
|
||||
break;
|
||||
if ((jiffies - start) >= HZ) {
|
||||
if (time_after_eq(jiffies, start + HZ)) {
|
||||
timed_out = 1;
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user