OSDN Git Service

[PATCH] ps2esdi: typo may cause premature timeout
authorWilly Tarreau <w@1wt.eu>
Sat, 25 Nov 2006 20:49:21 +0000 (21:49 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 25 Nov 2006 22:14:14 +0000 (23:14 +0100)
commit8f9ef6ad57f199f566bec80cb93bde0153604471
tree3c10e8177f9e78faae0fd77e2b3dacb217776789
parent843aad3daea921058fbce8103561bf7f2a6799a7
[PATCH] ps2esdi: typo may cause premature timeout

The stop condition in the following statement causes an immediate
break out of the loop because ESDI_TIMEOUT=0xf000 and the result
of the !(inb()) expression can only be either 0 or 1, which means
that i never gets counted down.

   for (i = ESDI_TIMEOUT;
        i & !(inb(ESDI_STATUS) & STATUS_STAT_AVAIL);
        i--);

The obvious cause is the use of "i & !" instead of "i && !". This
was already fixed in 2.6.

Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/block/ps2esdi.c