ide: never called printk statement in ide-taskfile.c::wait_drive_not_busy
authorMasatake YAMATO <jet@gyve.org>
Tue, 3 Jul 2007 20:28:34 +0000 (22:28 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 3 Jul 2007 20:28:34 +0000 (22:28 +0200)
commitb42fa133110fa952299fa76cbe91226c14838261
treed79f21a657f7145d12e7cee6118cf892a3e70561
parent872aad45d6174570dd2e1defc3efee50f2cfcc72
ide: never called printk statement in ide-taskfile.c::wait_drive_not_busy

Look at wait_drive_not_busy in drivers/ide/ide-taskfile.c:

    static u8 wait_drive_not_busy(ide_drive_t *drive)
    {
            ide_hwif_t *hwif = HWIF(drive);
            int retries = 100;
            u8 stat;

            /*
             * Last sector was transfered, wait until drive is ready.
             * This can take up to 10 usec, but we will wait max 1 ms
             * (drive_cmd_intr() waits that long).
             */
            while (((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) && retries--)
                    udelay(10);

            if (!retries)
                    printk(KERN_ERR "%s: drive still BUSY!\n", drive->name);

            return stat;
    }

`printk' is never called because `retries' never holds zero at the
outside of `while' loop: when `retries' holds zero at the while's loop
condition, `retries' will hold -1 at the if condition.

Signed-off-by: Masatake YAMATO <jet@gyve.org>
Cc: Chuck Ebbert <cebbert@redhat.com>
Cc: joe@perches.com
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-taskfile.c