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>
This commit is contained in:
Andrew Morton 2008-02-06 02:57:49 +01:00 committed by Bartlomiej Zolnierkiewicz
parent 1dcfdf93f6
commit b004223db7

View File

@ -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;
}