diff options
Diffstat (limited to 'drivers/ide/legacy')
-rw-r--r-- | drivers/ide/legacy/hd.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/ide/legacy/hd.c b/drivers/ide/legacy/hd.c index 8e05d88e81ba..0b0d86731927 100644 --- a/drivers/ide/legacy/hd.c +++ b/drivers/ide/legacy/hd.c | |||
@@ -421,11 +421,14 @@ static void bad_rw_intr(void) | |||
421 | 421 | ||
422 | static inline int wait_DRQ(void) | 422 | static inline int wait_DRQ(void) |
423 | { | 423 | { |
424 | int retries = 100000, stat; | 424 | int retries; |
425 | int stat; | ||
425 | 426 | ||
426 | while (--retries > 0) | 427 | for (retries = 0; retries < 100000; retries++) { |
427 | if ((stat = inb_p(HD_STATUS)) & DRQ_STAT) | 428 | stat = inb_p(HD_STATUS); |
429 | if (stat & DRQ_STAT) | ||
428 | return 0; | 430 | return 0; |
431 | } | ||
429 | dump_status("wait_DRQ", stat); | 432 | dump_status("wait_DRQ", stat); |
430 | return -1; | 433 | return -1; |
431 | } | 434 | } |