From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Feitoza Parisi Date: Sat, 16 Jul 2005 07:00:51 +0000 Subject: [KJ] [PATCH] drivers/net/tokenring/3c359.c : Use of the Message-Id: <42D8B0A3.9050807@feitoza.com.br> MIME-Version: 1 Content-Type: multipart/mixed; boundary="------------050804090507070701040406" List-Id: To: kernel-janitors@vger.kernel.org This is a multi-part message in MIME format. --------------050804090507070701040406 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit --------------050804090507070701040406 Content-Type: text/x-patch; name="3c359.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="3c359.patch" 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 --- 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 #include #include +#include #include @@ -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; } @@ -521,7 +522,7 @@ t=jiffies; while ( !(readw(xl_mmio + MMIO_INTSTATUS_AUTO) & INTSTAT_SRB) ) { schedule(); - if(jiffies-t > 15*HZ) { + if(time_after(jiffies, t + 15*HZ)) { printk(KERN_ERR "3COM 3C359 Velocity XL card not responding.\n"); return -ENODEV; } @@ -797,7 +798,7 @@ t=jiffies; while (! (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_SRB)) { schedule(); - if(jiffies-t > 40*HZ) { + if(time_after(jiffies, t + 40*HZ)) { printk(KERN_ERR "3COM 3C359 Velocity XL card not responding.\n"); break ; } @@ -1012,7 +1013,7 @@ t=jiffies; while (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_CMD_IN_PROGRESS) { - if(jiffies-t > 40*HZ) { + if(time_after(jiffies, t + 40*HZ)) { printk(KERN_ERR "3COM 3C359 Velocity XL card not responding.\n"); break ; } @@ -1284,7 +1285,7 @@ t=jiffies; while (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_CMD_IN_PROGRESS) { schedule(); - if(jiffies-t > 10*HZ) { + if(time_after(jiffies, t + 10*HZ)) { printk(KERN_ERR "%s: 3COM 3C359 Velocity XL-DNSTALL not responding.\n", dev->name); break ; } @@ -1293,7 +1294,7 @@ t=jiffies; while (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_CMD_IN_PROGRESS) { schedule(); - if(jiffies-t > 10*HZ) { + if(time_after(jiffies, t + 10*HZ)) { printk(KERN_ERR "%s: 3COM 3C359 Velocity XL-DNDISABLE not responding.\n", dev->name); break ; } @@ -1302,7 +1303,7 @@ t=jiffies; while (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_CMD_IN_PROGRESS) { schedule(); - if(jiffies-t > 10*HZ) { + if(time_after(jiffies, t + 10*HZ)) { printk(KERN_ERR "%s: 3COM 3C359 Velocity XL-UPSTALL not responding.\n", dev->name); break ; } @@ -1319,7 +1320,7 @@ t=jiffies; while (!(readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_SRB)) { schedule(); - if(jiffies-t > 10*HZ) { + if(time_after(jiffies, t + 10*HZ)) { printk(KERN_ERR "%s: 3COM 3C359 Velocity XL-CLOSENIC not responding.\n", dev->name); break ; } @@ -1348,7 +1349,7 @@ t=jiffies; while (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_CMD_IN_PROGRESS) { schedule(); - if(jiffies-t > 10*HZ) { + if(time_after(jiffies, t + 10*HZ)) { printk(KERN_ERR "%s: 3COM 3C359 Velocity XL-UPRESET not responding.\n", dev->name); break ; } @@ -1357,7 +1358,7 @@ t=jiffies; while (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_CMD_IN_PROGRESS) { schedule(); - if(jiffies-t > 10*HZ) { + if(time_after(jiffies, t + 10*HZ)) { printk(KERN_ERR "%s: 3COM 3C359 Velocity XL-DNRESET not responding.\n", dev->name); break ; } --------------050804090507070701040406 Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.osdl.org https://lists.osdl.org/mailman/listinfo/kernel-janitors --------------050804090507070701040406--