[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
@@ -83,6 +83,7 @@
|
||||
#include <linux/if_arp.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/if_shaper.h>
|
||||
#include <linux/jiffies.h>
|
||||
|
||||
#include <net/dst.h>
|
||||
#include <net/arp.h>
|
||||
@@ -168,7 +169,7 @@ static int shaper_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
/*
|
||||
* Queue over time. Spill packet.
|
||||
*/
|
||||
if(SHAPERCB(skb)->shapeclock-jiffies > SHAPER_LATENCY) {
|
||||
if(time_after(SHAPERCB(skb)->shapeclock,jiffies + SHAPER_LATENCY)) {
|
||||
dev_kfree_skb(skb);
|
||||
shaper->stats.tx_dropped++;
|
||||
} else
|
||||
|
Reference in New Issue
Block a user