diff options
author | gibbs <gibbs@FreeBSD.org> | 1998-12-22 18:14:50 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 1998-12-22 18:14:50 +0000 |
commit | 8a434eb2e315755b1fae378dfeed338b1ade3e55 (patch) | |
tree | 6b1d73c0bd6f9570ba7573f2a0f47c992b01ef91 /sys/dev/aha/aha.c | |
parent | b6ee7c1b3f3185be3c4e0f5feb5ae993c070d9c8 (diff) | |
download | FreeBSD-src-8a434eb2e315755b1fae378dfeed338b1ade3e55.zip FreeBSD-src-8a434eb2e315755b1fae378dfeed338b1ade3e55.tar.gz |
Don't calculate the residual twice.
Diffstat (limited to 'sys/dev/aha/aha.c')
-rw-r--r-- | sys/dev/aha/aha.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/aha/aha.c b/sys/dev/aha/aha.c index 4d9df2f..2478c8c 100644 --- a/sys/dev/aha/aha.c +++ b/sys/dev/aha/aha.c @@ -55,7 +55,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aha.c,v 1.15 1998/12/13 00:05:04 gibbs Exp $ + * $Id: aha.c,v 1.16 1998/12/15 02:51:54 imp Exp $ */ #include <sys/param.h> @@ -720,10 +720,10 @@ aha_find_probe_range(int ioport, int *port_index, int *max_port_index) break; if ((i >= AHA_NUM_ISAPORTS) || (ioport != aha_isa_ports[i].addr)) { - printf(" -aha_isa_probe: Invalid baseport of 0x%x specified. -aha_isa_probe: Nearest valid baseport is 0x%x. -aha_isa_probe: Failing probe.\n", + printf("\n" +"aha_isa_probe: Invalid baseport of 0x%x specified.\n" +"aha_isa_probe: Nearest valid baseport is 0x%x.\n" +"aha_isa_probe: Failing probe.\n", ioport, (i < AHA_NUM_ISAPORTS) ? aha_isa_ports[i].addr @@ -1360,13 +1360,16 @@ ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_co case AMBI_ABORT: case AMBI_ERROR: /* An error occured */ + csio->resid = aha_a24tou(accb->hccb.data_len); switch(accb->hccb.ahastat) { case AHASTAT_DATARUN_ERROR: - if (aha_a24tou(accb->hccb.data_len) <= 0) { + { + if (csio->resid <= 0) { csio->ccb_h.status = CAM_DATA_RUN_ERR; break; } /* FALLTHROUGH */ + } case AHASTAT_NOERROR: csio->scsi_status = accb->hccb.sdstat; csio->ccb_h.status |= CAM_SCSI_STATUS_ERROR; @@ -1389,7 +1392,6 @@ ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_co csio->ccb_h.status = CAM_REQ_CMP; break; } - csio->resid = aha_a24tou(accb->hccb.data_len); break; case AHASTAT_SELTIMEOUT: csio->ccb_h.status = CAM_SEL_TIMEOUT; |