Skip to content

Commit 0454c74

Browse files
RoelKluinJames Bottomley
authored andcommitted
[SCSI] nsp_cs: time_out reaches -1
With a postfix decrement timeouts will reach -1 rather than 0, so the errors do not appear. Signed-off-by: Roel Kluin <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: James Bottomley <[email protected]>
1 parent 18020ba commit 0454c74

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/scsi/pcmcia/nsp_cs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ static int nsp_negate_signal(struct scsi_cmnd *SCpnt, unsigned char mask,
530530
if (reg == 0xff) {
531531
break;
532532
}
533-
} while ((time_out-- != 0) && (reg & mask) != 0);
533+
} while ((--time_out != 0) && (reg & mask) != 0);
534534

535535
if (time_out == 0) {
536536
nsp_msg(KERN_DEBUG, " %s signal off timeut", str);
@@ -801,7 +801,7 @@ static void nsp_pio_read(struct scsi_cmnd *SCpnt)
801801

802802
data->FifoCount = ocount;
803803

804-
if (time_out == 0) {
804+
if (time_out < 0) {
805805
nsp_msg(KERN_DEBUG, "pio read timeout resid=%d this_residual=%d buffers_residual=%d",
806806
scsi_get_resid(SCpnt), SCpnt->SCp.this_residual,
807807
SCpnt->SCp.buffers_residual);
@@ -897,7 +897,7 @@ static void nsp_pio_write(struct scsi_cmnd *SCpnt)
897897

898898
data->FifoCount = ocount;
899899

900-
if (time_out == 0) {
900+
if (time_out < 0) {
901901
nsp_msg(KERN_DEBUG, "pio write timeout resid=0x%x",
902902
scsi_get_resid(SCpnt));
903903
}

0 commit comments

Comments
 (0)