aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy/hd.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2008-02-05 20:57:49 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-05 20:57:49 -0500
commitb004223db7249d42db893df916457acecc22759c (patch)
treea2aa63c6d1067bac0e2b2a36bde2d29d318eb7cd /drivers/ide/legacy/hd.c
parent1dcfdf93f66375567ec563de74bbb8c295ac88df (diff)
drivers/ide/legacy/hd.c: fix uninitialized var warning
drivers/ide/legacy/hd.c: In function 'hd_request': drivers/ide/legacy/hd.c:424: warning: 'stat' may be used uninitialized in this function gcc is being stupid. Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/legacy/hd.c')
-rw-r--r--drivers/ide/legacy/hd.c9
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
422static inline int wait_DRQ(void) 422static 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}