[PATCH] pcmcia: time_out reaches -1
Roel Kluin
roel.kluin at gmail.com
Mon Feb 16 06:06:43 EST 2009
Should maybe also (reg & mask) != 0 be placed before the timeout decrement?
--------------------------->8-------------8<------------------------------
With a postfix decrement the timeout will reach -1 rather than 0, so
the error does not appear.
Signed-off-by: Roel Kluin <roel.kluin at gmail.com>
---
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index 11a61ea..977f959 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -530,7 +530,7 @@ static int nsp_negate_signal(struct scsi_cmnd *SCpnt, unsigned char mask,
if (reg == 0xff) {
break;
}
- } while ((time_out-- != 0) && (reg & mask) != 0);
+ } while ((--time_out != 0) && (reg & mask) != 0);
if (time_out == 0) {
nsp_msg(KERN_DEBUG, " %s signal off timeut", str);
More information about the linux-pcmcia
mailing list