diff options
author | S.Caglar Onur <caglar@pardus.org.tr> | 2008-03-28 17:41:25 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-03-28 22:14:20 -0400 |
commit | b7aa69097acb86c118edaa5e339b714617062dfe (patch) | |
tree | c5843c8056f5c17e100f8337519cf11bc6611537 | |
parent | 9307b570a745da4f2d83195f5337927e98221bb2 (diff) |
drivers/net/tokenring/3c359.c: use time_* macros
The functions time_before, time_before_eq, time_after, and time_after_eq are
more robust for comparing jiffies against other values.
So use the time_after() macro, defined in linux/jiffies.h, which deals with
wrapping correctly.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: S.Caglar Onur <caglar@pardus.org.tr>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/net/tokenring/3c359.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c index 44a06f8b588f..45208a0e69a0 100644 --- a/drivers/net/tokenring/3c359.c +++ b/drivers/net/tokenring/3c359.c | |||
@@ -42,6 +42,7 @@ | |||
42 | 42 | ||
43 | #define XL_DEBUG 0 | 43 | #define XL_DEBUG 0 |
44 | 44 | ||
45 | #include <linux/jiffies.h> | ||
45 | #include <linux/module.h> | 46 | #include <linux/module.h> |
46 | #include <linux/kernel.h> | 47 | #include <linux/kernel.h> |
47 | #include <linux/errno.h> | 48 | #include <linux/errno.h> |
@@ -408,7 +409,7 @@ static int xl_hw_reset(struct net_device *dev) | |||
408 | t=jiffies; | 409 | t=jiffies; |
409 | while (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_CMD_IN_PROGRESS) { | 410 | while (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_CMD_IN_PROGRESS) { |
410 | schedule(); | 411 | schedule(); |
411 | if(jiffies-t > 40*HZ) { | 412 | if (time_after(jiffies, t + 40 * HZ)) { |
412 | printk(KERN_ERR "%s: 3COM 3C359 Velocity XL card not responding to global reset.\n", dev->name); | 413 | printk(KERN_ERR "%s: 3COM 3C359 Velocity XL card not responding to global reset.\n", dev->name); |
413 | return -ENODEV; | 414 | return -ENODEV; |
414 | } | 415 | } |
@@ -519,7 +520,7 @@ static int xl_hw_reset(struct net_device *dev) | |||
519 | t=jiffies; | 520 | t=jiffies; |
520 | while ( !(readw(xl_mmio + MMIO_INTSTATUS_AUTO) & INTSTAT_SRB) ) { | 521 | while ( !(readw(xl_mmio + MMIO_INTSTATUS_AUTO) & INTSTAT_SRB) ) { |
521 | schedule(); | 522 | schedule(); |
522 | if(jiffies-t > 15*HZ) { | 523 | if (time_after(jiffies, t + 15 * HZ)) { |
523 | printk(KERN_ERR "3COM 3C359 Velocity XL card not responding.\n"); | 524 | printk(KERN_ERR "3COM 3C359 Velocity XL card not responding.\n"); |
524 | return -ENODEV; | 525 | return -ENODEV; |
525 | } | 526 | } |
@@ -790,7 +791,7 @@ static int xl_open_hw(struct net_device *dev) | |||
790 | t=jiffies; | 791 | t=jiffies; |
791 | while (! (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_SRB)) { | 792 | while (! (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_SRB)) { |
792 | schedule(); | 793 | schedule(); |
793 | if(jiffies-t > 40*HZ) { | 794 | if (time_after(jiffies, t + 40 * HZ)) { |
794 | printk(KERN_ERR "3COM 3C359 Velocity XL card not responding.\n"); | 795 | printk(KERN_ERR "3COM 3C359 Velocity XL card not responding.\n"); |
795 | break ; | 796 | break ; |
796 | } | 797 | } |
@@ -1003,7 +1004,7 @@ static void xl_reset(struct net_device *dev) | |||
1003 | 1004 | ||
1004 | t=jiffies; | 1005 | t=jiffies; |
1005 | while (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_CMD_IN_PROGRESS) { | 1006 | while (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_CMD_IN_PROGRESS) { |
1006 | if(jiffies-t > 40*HZ) { | 1007 | if (time_after(jiffies, t + 40 * HZ)) { |
1007 | printk(KERN_ERR "3COM 3C359 Velocity XL card not responding.\n"); | 1008 | printk(KERN_ERR "3COM 3C359 Velocity XL card not responding.\n"); |
1008 | break ; | 1009 | break ; |
1009 | } | 1010 | } |
@@ -1270,7 +1271,7 @@ static int xl_close(struct net_device *dev) | |||
1270 | t=jiffies; | 1271 | t=jiffies; |
1271 | while (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_CMD_IN_PROGRESS) { | 1272 | while (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_CMD_IN_PROGRESS) { |
1272 | schedule(); | 1273 | schedule(); |
1273 | if(jiffies-t > 10*HZ) { | 1274 | if (time_after(jiffies, t + 10 * HZ)) { |
1274 | printk(KERN_ERR "%s: 3COM 3C359 Velocity XL-DNSTALL not responding.\n", dev->name); | 1275 | printk(KERN_ERR "%s: 3COM 3C359 Velocity XL-DNSTALL not responding.\n", dev->name); |
1275 | break ; | 1276 | break ; |
1276 | } | 1277 | } |
@@ -1279,7 +1280,7 @@ static int xl_close(struct net_device *dev) | |||
1279 | t=jiffies; | 1280 | t=jiffies; |
1280 | while (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_CMD_IN_PROGRESS) { | 1281 | while (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_CMD_IN_PROGRESS) { |
1281 | schedule(); | 1282 | schedule(); |
1282 | if(jiffies-t > 10*HZ) { | 1283 | if (time_after(jiffies, t + 10 * HZ)) { |
1283 | printk(KERN_ERR "%s: 3COM 3C359 Velocity XL-DNDISABLE not responding.\n", dev->name); | 1284 | printk(KERN_ERR "%s: 3COM 3C359 Velocity XL-DNDISABLE not responding.\n", dev->name); |
1284 | break ; | 1285 | break ; |
1285 | } | 1286 | } |
@@ -1288,7 +1289,7 @@ static int xl_close(struct net_device *dev) | |||
1288 | t=jiffies; | 1289 | t=jiffies; |
1289 | while (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_CMD_IN_PROGRESS) { | 1290 | while (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_CMD_IN_PROGRESS) { |
1290 | schedule(); | 1291 | schedule(); |
1291 | if(jiffies-t > 10*HZ) { | 1292 | if (time_after(jiffies, t + 10 * HZ)) { |
1292 | printk(KERN_ERR "%s: 3COM 3C359 Velocity XL-UPSTALL not responding.\n", dev->name); | 1293 | printk(KERN_ERR "%s: 3COM 3C359 Velocity XL-UPSTALL not responding.\n", dev->name); |
1293 | break ; | 1294 | break ; |
1294 | } | 1295 | } |
@@ -1305,7 +1306,7 @@ static int xl_close(struct net_device *dev) | |||
1305 | t=jiffies; | 1306 | t=jiffies; |
1306 | while (!(readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_SRB)) { | 1307 | while (!(readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_SRB)) { |
1307 | schedule(); | 1308 | schedule(); |
1308 | if(jiffies-t > 10*HZ) { | 1309 | if (time_after(jiffies, t + 10 * HZ)) { |
1309 | printk(KERN_ERR "%s: 3COM 3C359 Velocity XL-CLOSENIC not responding.\n", dev->name); | 1310 | printk(KERN_ERR "%s: 3COM 3C359 Velocity XL-CLOSENIC not responding.\n", dev->name); |
1310 | break ; | 1311 | break ; |
1311 | } | 1312 | } |
@@ -1334,7 +1335,7 @@ static int xl_close(struct net_device *dev) | |||
1334 | t=jiffies; | 1335 | t=jiffies; |
1335 | while (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_CMD_IN_PROGRESS) { | 1336 | while (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_CMD_IN_PROGRESS) { |
1336 | schedule(); | 1337 | schedule(); |
1337 | if(jiffies-t > 10*HZ) { | 1338 | if (time_after(jiffies, t + 10 * HZ)) { |
1338 | printk(KERN_ERR "%s: 3COM 3C359 Velocity XL-UPRESET not responding.\n", dev->name); | 1339 | printk(KERN_ERR "%s: 3COM 3C359 Velocity XL-UPRESET not responding.\n", dev->name); |
1339 | break ; | 1340 | break ; |
1340 | } | 1341 | } |
@@ -1343,7 +1344,7 @@ static int xl_close(struct net_device *dev) | |||
1343 | t=jiffies; | 1344 | t=jiffies; |
1344 | while (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_CMD_IN_PROGRESS) { | 1345 | while (readw(xl_mmio + MMIO_INTSTATUS) & INTSTAT_CMD_IN_PROGRESS) { |
1345 | schedule(); | 1346 | schedule(); |
1346 | if(jiffies-t > 10*HZ) { | 1347 | if (time_after(jiffies, t + 10 * HZ)) { |
1347 | printk(KERN_ERR "%s: 3COM 3C359 Velocity XL-DNRESET not responding.\n", dev->name); | 1348 | printk(KERN_ERR "%s: 3COM 3C359 Velocity XL-DNRESET not responding.\n", dev->name); |
1348 | break ; | 1349 | break ; |
1349 | } | 1350 | } |