resid -= cp->odd_byte_adjustment;  
int sym_compute_residual(struct sym_hcb *np, struct sym_ccb *cp){	int dp_sg, dp_sgmin, resid = 0;	int dp_ofs = 0;	/*	 *  Check for some data lost or just thrown away.	 *  We are not required to be quite accurate in this 	 *  situation. Btw, if we are odd for output and the 	 *  device claims some more data, it may well happen 	 *  than our residual be zero. :-)	 */	if (cp->xerr_status & (XE_EXTRA_DATA|XE_SODL_UNRUN|XE_SWIDE_OVRUN)) {		if (cp->xerr_status & XE_EXTRA_DATA)			resid -= cp->extra_bytes;		if (cp->xerr_status & XE_SODL_UNRUN)			++resid;		if (cp->xerr_status & XE_SWIDE_OVRUN)			--resid;	}	/*	 *  If all data has been transferred,	 *  there is no residual.	 */	if (cp->phys.head.lastp == sym_goalp(cp))		return resid;	/*	 *  If no data transfer occurs, or if the data	 *  pointer is weird, return full residual.	 */	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;	}	/*	 *  If we were auto-sensing, then we are done.	 */	if (cp->host_flags & HF_SENSE) {		return -dp_ofs;	}	/*	 *  We are now full comfortable in the computation 	 *  of the data residual (2's complement).	 */	dp_sgmin = SYM_CONF_MAX_SG - cp->segments;	resid = -cp->ext_ofs;	for (dp_sg = cp->ext_sg; dp_sg < SYM_CONF_MAX_SG; ++dp_sg) {		u_int tmp = scr_to_cpu(cp->phys.data[dp_sg].size);		resid += (tmp & 0xffffff);	}	/*	 *  Hopefully, the result is not too wrong.	 */	return resid;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/53222b906903fd861dc24ebccfa07ee125941313/sym_hipd.c/clean/drivers/scsi/sym53c8xx_2/sym_hipd.c