All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH] drivers/net/hp100.c : Use of time_after() macro
@ 2005-04-11 15:05 Marcelo Feitoza Parisi
  2005-04-13 16:09 ` Nish Aravamudan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Marcelo Feitoza Parisi @ 2005-04-11 15:05 UTC (permalink / raw)
  To: kernel-janitors

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

-- 
Marcelo Feitoza Parisi            
marcelo at feitoza.com.br
http://marcelo.feitoza.com.br/


Marcelo Feitoza Parisi <marcelo@feitoza.com.br>

--- linux/drivers/net/hp100.c	2005-03-02 04:38:04.000000000 -0300
+++ development/drivers/net/hp100.c	2005-04-09 18:42:14.000000000 -0300
@@ -115,6 +115,7 @@
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/bitops.h>
+#include <linux/jiffies.h>
 
 #include <asm/io.h>
 
@@ -1493,7 +1494,7 @@ static int hp100_start_xmit_bm(struct sk
 		printk("hp100: %s: start_xmit_bm: No TX PDL available.\n", dev->name);
 #endif
 		/* not waited long enough since last tx? */
-		if (jiffies - dev->trans_start < HZ)
+		if (time_after(jiffies, dev->trans_start - HZ))
 			return -EAGAIN;
 
 		if (hp100_check_lan(dev))
@@ -1646,7 +1647,7 @@ static int hp100_start_xmit(struct sk_bu
 		printk("hp100: %s: start_xmit: tx free mem = 0x%x\n", dev->name, i);
 #endif
 		/* not waited long enough since last failed tx try? */
-		if (jiffies - dev->trans_start < HZ) {
+		if (time_after(jiffies, dev->trans_start - HZ)) {
 #ifdef HP100_DEBUG
 			printk("hp100: %s: trans_start timing problem\n",
 			       dev->name);

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-07-08 18:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-11 15:05 [KJ] [PATCH] drivers/net/hp100.c : Use of time_after() macro Marcelo Feitoza Parisi
2005-04-13 16:09 ` Nish Aravamudan
2005-04-14 21:42 ` [KJ] [PATCH] drivers/net/hp100.c : Use of time_before() macro, Marcelo Feitoza Parisi
2005-07-08 18:41 ` [KJ] [PATCH] drivers/net/hp100.c : Use of time_before macro Marcelo Feitoza Parisi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.