Commit 0454c740 authored by Roel Kluin's avatar Roel Kluin Committed by James Bottomley

[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: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 18020ba7
...@@ -530,7 +530,7 @@ static int nsp_negate_signal(struct scsi_cmnd *SCpnt, unsigned char mask, ...@@ -530,7 +530,7 @@ static int nsp_negate_signal(struct scsi_cmnd *SCpnt, unsigned char mask,
if (reg == 0xff) { if (reg == 0xff) {
break; break;
} }
} while ((time_out-- != 0) && (reg & mask) != 0); } while ((--time_out != 0) && (reg & mask) != 0);
if (time_out == 0) { if (time_out == 0) {
nsp_msg(KERN_DEBUG, " %s signal off timeut", str); nsp_msg(KERN_DEBUG, " %s signal off timeut", str);
...@@ -801,7 +801,7 @@ static void nsp_pio_read(struct scsi_cmnd *SCpnt) ...@@ -801,7 +801,7 @@ static void nsp_pio_read(struct scsi_cmnd *SCpnt)
data->FifoCount = ocount; data->FifoCount = ocount;
if (time_out == 0) { if (time_out < 0) {
nsp_msg(KERN_DEBUG, "pio read timeout resid=%d this_residual=%d buffers_residual=%d", nsp_msg(KERN_DEBUG, "pio read timeout resid=%d this_residual=%d buffers_residual=%d",
scsi_get_resid(SCpnt), SCpnt->SCp.this_residual, scsi_get_resid(SCpnt), SCpnt->SCp.this_residual,
SCpnt->SCp.buffers_residual); SCpnt->SCp.buffers_residual);
...@@ -897,7 +897,7 @@ static void nsp_pio_write(struct scsi_cmnd *SCpnt) ...@@ -897,7 +897,7 @@ static void nsp_pio_write(struct scsi_cmnd *SCpnt)
data->FifoCount = ocount; data->FifoCount = ocount;
if (time_out == 0) { if (time_out < 0) {
nsp_msg(KERN_DEBUG, "pio write timeout resid=0x%x", nsp_msg(KERN_DEBUG, "pio write timeout resid=0x%x",
scsi_get_resid(SCpnt)); scsi_get_resid(SCpnt));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment