From: Andrew Morton Date: Wed, 6 Feb 2008 01:57:49 +0000 (+0100) Subject: drivers/ide/legacy/hd.c: fix uninitialized var warning X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b004223db7249d42db893df916457acecc22759c;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git 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 Signed-off-by: Bartlomiej Zolnierkiewicz --- 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) 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; }