Skip to contentSkip to conversation

drivers/net/hamradio/mkiss.c : Use of time_before macro

PATCH New [email protected] 1 participant 1 message Jul 14, 2005 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/net/hamradio/mkiss.c : Use of time_before macro

From: Marcelo Feitoza Parisi <[email protected]>

Use of time_before() macro, defined at linux/jiffies.h, which deal with wrapping correctly and are nicer to read.

---
 mkiss.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/hamradio/mkiss.c +2 -1
Index: quilt/drivers/net/hamradio/mkiss.c
===================================================================
@@ -46,6 +46,7 @@
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
 #include <linux/if_arp.h>
+#include <linux/jiffies.h>
 
 #include <net/ax25.h>
 
@@ -429,7 +430,7 @@ static int ax_xmit(struct sk_buff *skb, 
 		 * May be we must check transmitter timeout here ?
 		 *      14 Oct 1994 Dmitry Gorodchanin.
 		 */
-		if (jiffies - dev->trans_start  < 20 * HZ) {
+		if (time_before(jiffies, dev->trans_start + 20 * HZ)) {
 			/* 20 sec timeout not reached */
 			return 1;
 		}

--