All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] [PATCH] drivers/net/ne2k-pci.c : Use of the time_after() macro
Date: Sat, 16 Jul 2005 07:17:15 +0000	[thread overview]
Message-ID: <42D8B47B.3050304@feitoza.com.br> (raw)
In-Reply-To: <425F030B.5000008@feitoza.com.br>

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: ne2k-pci.patch --]
[-- Type: text/x-patch, Size: 1327 bytes --]

Use of the 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@feitoza.com.br>

--- linux/drivers/net/ne2k-pci.c	2005-07-13 17:53:29.000000000 -0300
+++ linux-kj/drivers/net/ne2k-pci.c	2005-07-15 22:21:44.302017824 -0300
@@ -280,7 +280,7 @@
 		*/
 		while ((inb(ioaddr + EN0_ISR) & ENISR_RESET) == 0)
 			/* Limit wait: '2' avoids jiffy roll-over. */
-			if (jiffies - reset_start_time > 2) {
+			if (time_after(jiffies, reset_start_time + 2)) {
 				printk(KERN_ERR PFX "Card failure (no reset ack).\n");
 				goto err_out_free_netdev;
 			}
@@ -453,7 +453,7 @@
 
 	/* This check _should_not_ be necessary, omit eventually. */
 	while ((inb(NE_BASE+EN0_ISR) & ENISR_RESET) == 0)
-		if (jiffies - reset_start_time > 2) {
+		if (time_after(jiffies, reset_start_time + 2)) {
 			printk("%s: ne2k_pci_reset_8390() did not complete.\n", dev->name);
 			break;
 		}
@@ -610,7 +610,7 @@
 	dma_start = jiffies;
 
 	while ((inb(nic_base + EN0_ISR) & ENISR_RDC) == 0)
-		if (jiffies - dma_start > 2) {			/* Avoid clock roll-over. */
+		if (time_after(jiffies, dma_start + 2)) {	/* Avoid clock roll-over. */
 			printk(KERN_WARNING "%s: timeout waiting for Tx RDC.\n", dev->name);
 			ne2k_pci_reset_8390(dev);
 			NS8390_init(dev,1);

[-- Attachment #3: Type: text/plain, Size: 168 bytes --]

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

  parent reply	other threads:[~2005-07-16  7:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-14 23:55 [KJ] [PATCH] drivers/net/ne2k-pci.c : Use of time_after() macro Marcelo Feitoza Parisi
2005-04-15  1:33 ` Mark Hollomon
2005-07-16  7:17 ` Marcelo Feitoza Parisi [this message]
2005-07-18 16:18 ` [KJ] [PATCH] drivers/net/ne2k-pci.c : Use of the time_after() Domen Puncer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42D8B47B.3050304@feitoza.com.br \
    --to=marcelo@feitoza.com.br \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.