diff options
Diffstat (limited to 'drivers/ide/pci/cmd640.c')
-rw-r--r-- | drivers/ide/pci/cmd640.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c index fed93417d54a..662099a98a72 100644 --- a/drivers/ide/pci/cmd640.c +++ b/drivers/ide/pci/cmd640.c | |||
@@ -561,15 +561,15 @@ static void cmd640_set_mode(ide_drive_t *drive, unsigned int index, | |||
561 | active_time = ide_pio_timings[pio_mode].active_time; | 561 | active_time = ide_pio_timings[pio_mode].active_time; |
562 | recovery_time = cycle_time - (setup_time + active_time); | 562 | recovery_time = cycle_time - (setup_time + active_time); |
563 | clock_time = 1000 / bus_speed; | 563 | clock_time = 1000 / bus_speed; |
564 | cycle_count = (cycle_time + clock_time - 1) / clock_time; | 564 | cycle_count = DIV_ROUND_UP(cycle_time, clock_time); |
565 | 565 | ||
566 | setup_count = (setup_time + clock_time - 1) / clock_time; | 566 | setup_count = DIV_ROUND_UP(setup_time, clock_time); |
567 | 567 | ||
568 | active_count = (active_time + clock_time - 1) / clock_time; | 568 | active_count = DIV_ROUND_UP(active_time, clock_time); |
569 | if (active_count < 2) | 569 | if (active_count < 2) |
570 | active_count = 2; /* minimum allowed by cmd640 */ | 570 | active_count = 2; /* minimum allowed by cmd640 */ |
571 | 571 | ||
572 | recovery_count = (recovery_time + clock_time - 1) / clock_time; | 572 | recovery_count = DIV_ROUND_UP(recovery_time, clock_time); |
573 | recovery_count2 = cycle_count - (setup_count + active_count); | 573 | recovery_count2 = cycle_count - (setup_count + active_count); |
574 | if (recovery_count2 > recovery_count) | 574 | if (recovery_count2 > recovery_count) |
575 | recovery_count = recovery_count2; | 575 | recovery_count = recovery_count2; |