From b004223db7249d42db893df916457acecc22759c Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 6 Feb 2008 02:57:49 +0100 Subject: [PATCH] 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 --- drivers/ide/legacy/hd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/ide/legacy/hd.c b/drivers/ide/legacy/hd.c index 8e05d88e81..0b0d867319 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; } -- 2.39.5