[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
@ -258,6 +258,7 @@ static int vortex_debug = 1;
|
||||
#include <linux/highmem.h>
|
||||
#include <linux/eisa.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include <asm/irq.h> /* For NR_IRQS only. */
|
||||
#include <asm/io.h>
|
||||
#include <asm/uaccess.h>
|
||||
@ -2717,7 +2718,7 @@ boomerang_rx(struct net_device *dev)
|
||||
skb = dev_alloc_skb(PKT_BUF_SZ);
|
||||
if (skb == NULL) {
|
||||
static unsigned long last_jif;
|
||||
if ((jiffies - last_jif) > 10 * HZ) {
|
||||
if (time_after(jiffies, last_jif + 10 * HZ)) {
|
||||
printk(KERN_WARNING "%s: memory shortage\n", dev->name);
|
||||
last_jif = jiffies;
|
||||
}
|
||||
|
Reference in New Issue
Block a user