Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ncr5380: Harmonize jiffies conversion with msecs_to_jiffies

Instances of var * HZ / 1000 are replaced by msecs_to_jiffies(var).
In addition some timing constants that assumed HZ 100 were adjusted
to HZ independent settings based on review comments from Michael Schmitz
<schmitzmic@gmail.com> and review of the original drivers in 1.0.31 and
2.2.16.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Acked-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>

authored by

Nicholas Mc Guire and committed by
James Bottomley
4e5a800c b026e8ed

+9 -9
+5 -5
drivers/scsi/NCR5380.c
··· 474 474 */ 475 475 #ifndef USLEEP_SLEEP 476 476 /* 20 ms (reasonable hard disk speed) */ 477 - #define USLEEP_SLEEP (20*HZ/1000) 477 + #define USLEEP_SLEEP msecs_to_jiffies(20) 478 478 #endif 479 479 /* 300 RPM (floppy speed) */ 480 480 #ifndef USLEEP_POLL 481 - #define USLEEP_POLL (200*HZ/1000) 481 + #define USLEEP_POLL msecs_to_jiffies(200) 482 482 #endif 483 483 #ifndef USLEEP_WAITLONG 484 484 /* RvC: (reasonable time to wait on select error) */ ··· 576 576 if ((mask & possible) && (request_irq(i, &probe_intr, 0, "NCR-probe", NULL) == 0)) 577 577 trying_irqs |= mask; 578 578 579 - timeout = jiffies + (250 * HZ / 1000); 579 + timeout = jiffies + msecs_to_jiffies(250); 580 580 probe_irq = NO_IRQ; 581 581 582 582 /* ··· 634 634 "sg_tablesize %d, this_id %d, " 635 635 "flags { %s%s%s}, " 636 636 #if defined(USLEEP_POLL) && defined(USLEEP_WAITLONG) 637 - "USLEEP_POLL %d, USLEEP_WAITLONG %d, " 637 + "USLEEP_POLL %lu, USLEEP_WAITLONG %lu, " 638 638 #endif 639 639 "options { %s} ", 640 640 instance->hostt->name, instance->io_port, instance->n_io_port, ··· 1346 1346 * selection. 1347 1347 */ 1348 1348 1349 - timeout = jiffies + (250 * HZ / 1000); 1349 + timeout = jiffies + msecs_to_jiffies(250); 1350 1350 1351 1351 /* 1352 1352 * XXX very interesting - we're seeing a bounce where the BSY we
+1 -1
drivers/scsi/atari_NCR5380.c
··· 1486 1486 * selection. 1487 1487 */ 1488 1488 1489 - timeout = jiffies + (250 * HZ / 1000); 1489 + timeout = jiffies + msecs_to_jiffies(250); 1490 1490 1491 1491 /* 1492 1492 * XXX very interesting - we're seeing a bounce where the BSY we
+3 -3
drivers/scsi/g_NCR5380.c
··· 57 57 */ 58 58 59 59 /* settings for DTC3181E card with only Mustek scanner attached */ 60 - #define USLEEP_POLL 1 61 - #define USLEEP_SLEEP 20 62 - #define USLEEP_WAITLONG 500 60 + #define USLEEP_POLL msecs_to_jiffies(10) 61 + #define USLEEP_SLEEP msecs_to_jiffies(200) 62 + #define USLEEP_WAITLONG msecs_to_jiffies(5000) 63 63 64 64 #define AUTOPROBE_IRQ 65 65