Skip to contentSkip to conversation

drivers/net/seeq8005.c : Use of the time_before() macro

PATCH New Marcelo Feitoza Parisi 1 participant 1 message Jul 16, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/net/seeq8005.c : Use of the time_before() macro

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

drivers/net/seeq8005.c +3 -2
@@ -699,7 +699,7 @@
 	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 +724,8 @@
 	
 	/* 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 ! */

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors