Skip to content

Commit

Permalink
drivers/ide/legacy/hd.c: fix uninitialized var warning
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrew Morton authored and Bartlomiej Zolnierkiewicz committed Feb 6, 2008
1 parent 1dcfdf9 commit b004223
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/ide/legacy/hd.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,14 @@ static void bad_rw_intr(void)

static inline int wait_DRQ(void)
{
int retries = 100000, stat;
int retries;
int stat;

while (--retries > 0)
if ((stat = inb_p(HD_STATUS)) & DRQ_STAT)
for (retries = 0; retries < 100000; retries++) {
stat = inb_p(HD_STATUS);
if (stat & DRQ_STAT)
return 0;
}
dump_status("wait_DRQ", stat);
return -1;
}
Expand Down

0 comments on commit b004223

Please sign in to comment.