/* SCPNT_TO_LOOKUP_IDX - searches for a given scmd in the ScsiLookup array list @ioc: Pointer to MPT_ADAPTER structure @sc: scsi_cmnd pointer  */
static int SCPNT_TO_LOOKUP_IDX(MPT_ADAPTER *ioc, struct scsi_cmnd *scmd)
/* SCPNT_TO_LOOKUP_IDX - searches for a given scmd in the ScsiLookup array list @ioc: Pointer to MPT_ADAPTER structure @sc: scsi_cmnd pointer  */
static int SCPNT_TO_LOOKUP_IDX(MPT_ADAPTER *ioc, struct scsi_cmnd *scmd)
{
	unsigned long	flags;
	int i, index=-1;
	spin_lock_irqsave(&ioc->scsi_lookup_lock, flags);
	for (i = 0; i < ioc->req_depth; i++) {
		if (ioc->ScsiLookup[i] == sc) {
			index = i;
			goto out;
		}
	}
 out:
	spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags);
	return index;
}