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/shaper.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/shaper.c')
-rw-r--r-- | drivers/net/shaper.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/shaper.c b/drivers/net/shaper.c index 221354eea21f..88e212043a43 100644 --- a/drivers/net/shaper.c +++ b/drivers/net/shaper.c | |||
@@ -83,6 +83,7 @@ | |||
83 | #include <linux/if_arp.h> | 83 | #include <linux/if_arp.h> |
84 | #include <linux/init.h> | 84 | #include <linux/init.h> |
85 | #include <linux/if_shaper.h> | 85 | #include <linux/if_shaper.h> |
86 | #include <linux/jiffies.h> | ||
86 | 87 | ||
87 | #include <net/dst.h> | 88 | #include <net/dst.h> |
88 | #include <net/arp.h> | 89 | #include <net/arp.h> |
@@ -168,7 +169,7 @@ static int shaper_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
168 | /* | 169 | /* |
169 | * Queue over time. Spill packet. | 170 | * Queue over time. Spill packet. |
170 | */ | 171 | */ |
171 | if(SHAPERCB(skb)->shapeclock-jiffies > SHAPER_LATENCY) { | 172 | if(time_after(SHAPERCB(skb)->shapeclock,jiffies + SHAPER_LATENCY)) { |
172 | dev_kfree_skb(skb); | 173 | dev_kfree_skb(skb); |
173 | shaper->stats.tx_dropped++; | 174 | shaper->stats.tx_dropped++; |
174 | } else | 175 | } else |