Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b42fa133110fa952299fa76cbe91226c14838261
Commit:     b42fa133110fa952299fa76cbe91226c14838261
Parent:     872aad45d6174570dd2e1defc3efee50f2cfcc72
Author:     Masatake YAMATO <[EMAIL PROTECTED]>
AuthorDate: Tue Jul 3 22:28:34 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Tue Jul 3 22:28:34 2007 +0200

    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 <[EMAIL PROTECTED]>
    Cc: Chuck Ebbert <[EMAIL PROTECTED]>
    Cc: [EMAIL PROTECTED]
    Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-taskfile.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 30175c7..aa06daf 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -238,7 +238,7 @@ EXPORT_SYMBOL(task_no_data_intr);
 static u8 wait_drive_not_busy(ide_drive_t *drive)
 {
        ide_hwif_t *hwif = HWIF(drive);
-       int retries = 100;
+       int retries;
        u8 stat;
 
        /*
@@ -246,10 +246,14 @@ static u8 wait_drive_not_busy(ide_drive_t *drive)
         * 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);
+       for (retries = 0; retries < 100; retries++) {
+               if ((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT)
+                       udelay(10);
+               else
+                       break;
+       }
 
-       if (!retries)
+       if (stat & BUSY_STAT)
                printk(KERN_ERR "%s: drive still BUSY!\n", drive->name);
 
        return stat;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to