[patch 2/2] drivers/net/tokenring/lanstreamer.c : Use of time_after macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Marcelo Feitoza Parisi <marcelo@xxxxxxxxxxxxxx>


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

Signed-off-by: Marcelo Feitoza Parisi <marcelo@xxxxxxxxxxxxxx>
Signed-off-by: Domen Puncer <domen@xxxxxxxxxxxx>

---
 lanstreamer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

Index: quilt/drivers/net/tokenring/lanstreamer.c
===================================================================
--- quilt.orig/drivers/net/tokenring/lanstreamer.c
+++ quilt/drivers/net/tokenring/lanstreamer.c
@@ -123,6 +123,7 @@
 #include <linux/version.h>
 #include <linux/bitops.h>
 #include <linux/wait.h>
+#include <linux/jiffies.h>
 
 #include <net/checksum.h>
 
@@ -513,7 +514,7 @@ static int streamer_reset(struct net_dev
 
 	while (!((readw(streamer_mmio + SISR)) & SISR_SRB_REPLY)) {
 		msleep_interruptible(100);
-		if (jiffies - t > 40 * HZ) {
+		if (time_after(jiffies, t + 40 * HZ)) {
 			printk(KERN_ERR
 			       "IBM PCI tokenring card not responding\n");
 			release_region(dev->base_addr, STREAMER_IO_SPACE);

--
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux