/* This will search for a matching channel:id:lun in the scsi_lookup array, returning 1 if found.  */
static u8 _scsih_scsi_lookup_find_by_lun(struct MPT2SAS_ADAPTER *ioc, int id, unsigned int lun, int channel)
/* This will search for a matching channel:id:lun in the scsi_lookup array, returning 1 if found.  */
static u8 _scsih_scsi_lookup_find_by_lun(struct MPT2SAS_ADAPTER *ioc, int id, unsigned int lun, int channel)
{
	u8 found;
	unsigned long	flags;
	int i;
	spin_lock_irqsave(&ioc->scsi_lookup_lock, flags);
	found = 0;
	for (i = 0 ; i < ioc->scsiio_depth; i++) {
		if (ioc->scsi_lookup[i].scmd &&
		    (ioc->scsi_lookup[i].scmd->device->id == id &&
		    ioc->scsi_lookup[i].scmd->device->channel == channel &&
		    ioc->scsi_lookup[i].scmd->device->lun == lun)) {
			found = 1;
			goto out;
		}
	}
 out:
	spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags);
	return found;
}