/* This will search for a scmd pointer in the scsi_lookup array, returning the revelent smid. A returned value of zero means invalid.  */
static u16 _scsih_scsi_lookup_find_by_scmd(struct MPT2SAS_ADAPTER *ioc, struct scsi_cmnd *scmd)
/* This will search for a scmd pointer in the scsi_lookup array, returning the revelent smid. A returned value of zero means invalid.  */
static u16 _scsih_scsi_lookup_find_by_scmd(struct MPT2SAS_ADAPTER *ioc, struct scsi_cmnd *scmd)
{
	u16 smid;
	unsigned long	flags;
	int i;
	spin_lock_irqsave(&ioc->scsi_lookup_lock, flags);
	smid = 0;
	for (i = 0; i < ioc->scsiio_depth; i++) {
		if (ioc->scsi_lookup[i].scmd == scmd) {
			smid = ioc->scsi_lookup[i].smid;
			goto out;
		}
	}
 out:
	spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags);
	return smid;
}