From: Domen Puncer <domen@coderock.org>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] [PATCH] drivers/net/cs89x0.c : Use of time_after(),
Date: Mon, 18 Jul 2005 14:05:21 +0000 [thread overview]
Message-ID: <20050718140521.GA2457@homer.coderock.org> (raw)
In-Reply-To: <42D8B1D6.2090302@feitoza.com.br>
[-- Attachment #1: Type: text/plain, Size: 1563 bytes --]
On 16/07/05 04:05 -0300, Marcelo Feitoza Parisi wrote:
>
> Use of time_after(), time_after_eq() and time_before() macros, define 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/cs89x0.c 2005-07-13 17:52:18.000000000 -0300
> +++ linux-kj/drivers/net/cs89x0.c 2005-07-15 21:55:17.376267208 -0300
> @@ -93,6 +93,7 @@
> or override something. */
> #include <linux/config.h>
> #include <linux/module.h>
> +#include <linux/jiffies.h>
>
> /*
> * Set this to zero to disable DMA code
> @@ -363,12 +364,12 @@
> static int __init
> wait_eeprom_ready(struct net_device *dev)
> {
> - int timeout = jiffies;
> + unsigned long timeout = jiffies;
> /* check to see if the EEPROM is ready, a timeout is used -
> just in case EEPROM is ready when SI_BUSY in the
> PP_SelfST is clear */
> while(readreg(dev, PP_SelfST) & SI_BUSY)
> - if (jiffies - timeout >= 40)
> + if (time_after_eq(jiffies, timeout + 40))
linux.bkbits.net tells me:
2002/02/05 torvalds | if (jiffies - timeout >= 40)
And since this is a i386 driver (cs89x0.txt), HZ was 100 back then.
So... change this to msecs_to_jiffies(400) to make it right?
Same goes for the rest of patch.
> @@ -958,7 +959,8 @@
>
> /* Wait until the chip is reset */
> reset_start_time = jiffies;
> - while( (readreg(dev, PP_SelfST) & INIT_DONE) == 0 && jiffies - reset_start_time < 2)
> + while( (readreg(dev, PP_SelfST) & INIT_DONE) == 0 &&
while ((...
[-- 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
prev parent reply other threads:[~2005-07-18 14:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-16 7:05 [KJ] [PATCH] drivers/net/cs89x0.c : Use of time_after(), Marcelo Feitoza Parisi
2005-07-18 14:05 ` 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=20050718140521.GA2457@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.