From: Tony Battersby Date: Tue, 6 Nov 2007 21:07:04 +0000 (-0500) Subject: [SCSI] sym53c8xx: fix resid calculation X-Git-Tag: v2.6.25-rc1~285^2~43 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3dfcb701e1ff7aa21d6623e46b6ec3f7d0d306e1;p=linux-2.6 [SCSI] sym53c8xx: fix resid calculation This patch fixes the calculation of the data transfer residual for the case of a command that is supposed to transfer an odd number of bytes on a wide bus but transfers nothing instead. Signed-off-by: Tony Battersby Cc: Matthew Wilcox Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c index 254bdaeb35..35142b5341 100644 --- a/drivers/scsi/sym53c8xx_2/sym_hipd.c +++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c @@ -3842,7 +3842,7 @@ int sym_compute_residual(struct sym_hcb *np, struct sym_ccb *cp) if (cp->startp == cp->phys.head.lastp || sym_evaluate_dp(np, cp, scr_to_cpu(cp->phys.head.lastp), &dp_ofs) < 0) { - return cp->data_len; + return cp->data_len - cp->odd_byte_adjustment; } /*