Skip to contentSkip to conversation

sym53c8xx: fix resid calculation

PATCH New Tony Battersby 1 participant 1 message Nov 6, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

drivers/scsi/sym53c8xx_2/sym_hipd.c renamed from drivers/scsi/sym53c8xx_2/sym_hipd.c.orig +1 -1
@@ -3842,7 +3842,7 @@ int sym_compute_residual(struct sym_hcb 
 	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;
 	}
 
 	/*