[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1209094676-20360-2-git-send-email-cooloney@kernel.org>
Date: Fri, 25 Apr 2008 11:37:54 +0800
From: Bryan Wu <cooloney@...nel.org>
To: jgarzik@...ox.com, linux-ide@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Roel Kluin <12o3l@...cali.nl>, Bryan Wu <cooloney@...nel.org>
Subject: [PATCH 1/3] [libata/BF54x]: decrease count first.
From: Roel Kluin <12o3l@...cali.nl>
When count reaches 0 the postfix decrement still subtracts (to -1), so
bfin_reset_controller() returns as if the busy flag was cleared while it was not.
Signed-off-by: Roel Kluin <12o3l@...cali.nl>
Acked-by: Sonic Zhang <sonic.zhang@...log.com>
Signed-off-by: Bryan Wu <cooloney@...nel.org>
---
drivers/ata/pata_bf54x.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/ata/pata_bf54x.c b/drivers/ata/pata_bf54x.c
index 0a5ad98..f334ba5 100644
--- a/drivers/ata/pata_bf54x.c
+++ b/drivers/ata/pata_bf54x.c
@@ -1417,7 +1417,7 @@ static int bfin_reset_controller(struct ata_host *host)
count = 10000000;
do {
status = read_atapi_register(base, ATA_REG_STATUS);
- } while (count-- && (status & ATA_BUSY));
+ } while (--count && (status & ATA_BUSY));
/* Enable only ATAPI Device interrupt */
ATAPI_SET_INT_MASK(base, 1);
--
1.5.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists