You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[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
@@ -46,6 +46,7 @@ static const char version[] =
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/jiffies.h>
|
||||
|
||||
#include <asm/system.h>
|
||||
#include <asm/io.h>
|
||||
@@ -699,7 +700,7 @@ static void hardware_send_packet(struct net_device * dev, char *buf, int length)
|
||||
int ioaddr = dev->base_addr;
|
||||
int status = inw(SEEQ_STATUS);
|
||||
int transmit_ptr = 0;
|
||||
int tmp;
|
||||
unsigned long tmp;
|
||||
|
||||
if (net_debug>4) {
|
||||
printk("%s: send 0x%04x\n",dev->name,length);
|
||||
@@ -724,7 +725,7 @@ static void hardware_send_packet(struct net_device * dev, char *buf, int length)
|
||||
|
||||
/* drain FIFO */
|
||||
tmp = jiffies;
|
||||
while ( (((status=inw(SEEQ_STATUS)) & SEEQSTAT_FIFO_EMPTY) == 0) && (jiffies - tmp < HZ))
|
||||
while ( (((status=inw(SEEQ_STATUS)) & SEEQSTAT_FIFO_EMPTY) == 0) && time_before(jiffies, tmp + HZ))
|
||||
mb();
|
||||
|
||||
/* doit ! */
|
||||
|
||||
Reference in New Issue
Block a user