All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH] drivers/net/es3210.c : Use of the time_after() macro
@ 2005-07-16  7:10 Marcelo Feitoza Parisi
  2005-07-29  9:42 ` Domen Puncer
  0 siblings, 1 reply; 2+ messages in thread
From: Marcelo Feitoza Parisi @ 2005-07-16  7:10 UTC (permalink / raw)
  To: kernel-janitors

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



[-- Attachment #2: es3210.patch --]
[-- Type: text/x-patch, Size: 790 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/es3210.c	2005-07-13 17:52:19.000000000 -0300
+++ linux-kj/drivers/net/es3210.c	2005-07-15 23:58:12.537072344 -0300
@@ -56,6 +56,7 @@
 #include <linux/init.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
+#include <linux/jiffies.h>
 
 #include <asm/io.h>
 #include <asm/system.h>
@@ -331,7 +332,7 @@
 	if (ei_debug > 1) printk("%s: resetting the ES3210...", dev->name);
 
 	end = jiffies + 2*HZ/100;
-        while ((signed)(end - jiffies) > 0) continue;
+        while (time_after(end, jiffies)) continue;
 
 	ei_status.txing = 0;
 	outb(0x01, ioaddr + ES_RESET_PORT);

[-- 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [KJ] [PATCH] drivers/net/es3210.c : Use of the time_after() macro
  2005-07-16  7:10 [KJ] [PATCH] drivers/net/es3210.c : Use of the time_after() macro Marcelo Feitoza Parisi
@ 2005-07-29  9:42 ` Domen Puncer
  0 siblings, 0 replies; 2+ messages in thread
From: Domen Puncer @ 2005-07-29  9:42 UTC (permalink / raw)
  To: kernel-janitors

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

On 16/07/05 04:10 -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/es3210.c	2005-07-13 17:52:19.000000000 -0300
> +++ linux-kj/drivers/net/es3210.c	2005-07-15 23:58:12.537072344 -0300
> @@ -56,6 +56,7 @@
>  #include <linux/init.h>
>  #include <linux/netdevice.h>
>  #include <linux/etherdevice.h>
> +#include <linux/jiffies.h>
>  
>  #include <asm/io.h>
>  #include <asm/system.h>
> @@ -331,7 +332,7 @@
>  	if (ei_debug > 1) printk("%s: resetting the ES3210...", dev->name);
>  
>  	end = jiffies + 2*HZ/100;
> -        while ((signed)(end - jiffies) > 0) continue;
> +        while (time_after(end, jiffies)) continue;

Seems like I missed this on the first review...
msleep(20) should be much better here.

>  
>  	ei_status.txing = 0;
>  	outb(0x01, ioaddr + ES_RESET_PORT);

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


[-- 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-07-29  9:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-16  7:10 [KJ] [PATCH] drivers/net/es3210.c : Use of the time_after() macro Marcelo Feitoza Parisi
2005-07-29  9:42 ` Domen Puncer

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.