All of lore.kernel.org
 help / color / mirror / Atom feed
From: Domen Puncer <domen@coderock.org>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] [PATCH] drivers/net/tokenring/3c359.c : Use of the
Date: Sat, 16 Jul 2005 10:00:07 +0000	[thread overview]
Message-ID: <20050716100007.GA2462@homer.coderock.org> (raw)
In-Reply-To: <42D8B0A3.9050807@feitoza.com.br>

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

On 16/07/05 04:00 -0300, Marcelo Feitoza Parisi wrote:
> 

> 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/tokenring/3c359.c	2005-07-13 17:53:30.000000000 -0300
> +++ linux-kj/drivers/net/tokenring/3c359.c	2005-07-16 01:00:27.145325592 -0300
> @@ -62,6 +62,7 @@
>  #include <linux/pci.h>
>  #include <linux/spinlock.h>
>  #include <linux/bitops.h>
> +#include <linux/jiffies.h>
>  
>  #include <net/checksum.h>
>  
> @@ -410,7 +411,7 @@
>  	t=jiffies;
>  	while (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_CMD_IN_PROGRESS) { 
>  		schedule();		
> -		if(jiffies-t > 40*HZ) {
> +		if(time_after(jiffies, t + 40*HZ)) {
>  			printk(KERN_ERR "%s: 3COM 3C359 Velocity XL  card not responding to global reset.\n", dev->name);
>  			return -ENODEV;
>  		}

There are 7 of these, almost exactly the same.
Maybe a nice wrapper?

> @@ -521,7 +522,7 @@
>  	t=jiffies;
>  	while ( !(readw(xl_mmio + MMIO_INTSTATUS_AUTO) & INTSTAT_SRB) ) { 
>  		schedule();		

This looks at least a bit weird. No set_current_state()? And if it
were, would it ever return?

> -		if(jiffies-t > 15*HZ) {
> +		if(time_after(jiffies, t + 15*HZ)) {

		  ^ space missing


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

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

      reply	other threads:[~2005-07-16 10:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-16  7:00 [KJ] [PATCH] drivers/net/tokenring/3c359.c : Use of the Marcelo Feitoza Parisi
2005-07-16 10:00 ` Domen Puncer [this message]

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=20050716100007.GA2462@homer.coderock.org \
    --to=domen@coderock.org \
    --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.