All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Hollomon <markhollomon@comcast.net>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] [PATCH] drivers/net/ne2k-pci.c : Use of time_after() macro
Date: Fri, 15 Apr 2005 01:33:06 +0000	[thread overview]
Message-ID: <425F19D2.1010100@comcast.net> (raw)
In-Reply-To: <425F030B.5000008@feitoza.com.br>

Marcelo Feitoza Parisi wrote:
> Added the use of time_after() macro, that is defined at linux/jiffies.h
> 
> Signed-off-by: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>
> 
> --- linux/drivers/net/ne2k-pci.c    2005-04-07 22:25:51.000000000 -0300
> +++ development/drivers/net/ne2k-pci.c    2005-04-14 20:00:28.000000000 
> -0300
> @@ -53,6 +53,7 @@
> #include <linux/ethtool.h>
> #include <linux/netdevice.h>
> #include <linux/etherdevice.h>
> +#include <linux/jiffies.h>
> 
> #include <asm/system.h>
> #include <asm/io.h>
> @@ -271,7 +272,7 @@
> 
>     /* Reset card. Who knows what dain-bramaged state it was left in. */
>     {
> -        unsigned long reset_start_time = jiffies;
> +        unsigned long reset_start_time = jiffies + 2;

A nit pick, but if you add 2 to jiffies, it is no longer the reset start time. 
Maybe rename the variable reset_timeout or something.

> 
>         outb(inb(ioaddr + NE_RESET), ioaddr + NE_RESET);
> 
> @@ -280,7 +281,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)) {
>                 printk(KERN_ERR PFX "Card failure (no reset ack).\n");
>                 goto err_out_free_netdev;
>             }
> @@ -441,7 +442,7 @@
>    8390 reset command required, but that shouldn't be necessary. */
> static void ne2k_pci_reset_8390(struct net_device *dev)
> {
> -    unsigned long reset_start_time = jiffies;
> +    unsigned long reset_start_time = jiffies + 2;

ditto

> 
>     if (debug > 1) printk("%s: Resetting the 8390 t=%ld...",
>                           dev->name, jiffies);
> @@ -453,7 +454,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)) {
>             printk("%s: ne2k_pci_reset_8390() did not complete.\n", 
> dev->name);
>             break;
>         }
> @@ -607,10 +608,10 @@
>         }
>     }
> 
> -    dma_start = jiffies;
> +    dma_start = jiffies + 2;

ditto

> 
>     while ((inb(nic_base + EN0_ISR) & ENISR_RDC) = 0)
> -        if (jiffies - dma_start > 2) {            /* Avoid clock 
> roll-over. */
> +        if (time_after(jiffies, dma_start)) {            /* 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);
> 
> _______________________________________________
> Kernel-janitors mailing list
> Kernel-janitors@lists.osdl.org
> http://lists.osdl.org/mailman/listinfo/kernel-janitors
> 


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

  reply	other threads:[~2005-04-15  1:33 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 [this message]
2005-07-16  7:17 ` [KJ] [PATCH] drivers/net/ne2k-pci.c : Use of the " Marcelo Feitoza Parisi
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=425F19D2.1010100@comcast.net \
    --to=markhollomon@comcast.net \
    --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.