/* Return codes: NULL - Error Pointer to lpfc_scsi_buf - Success  */
static struct lpfc_scsi_buf* lpfc_get_scsi_buf(struct lpfc_hba *phba)
/* Return codes: NULL - Error Pointer to lpfc_scsi_buf - Success  */
static struct lpfc_scsi_buf* lpfc_get_scsi_buf(struct lpfc_hba *phba)
{
	struct  lpfc_scsi_buf * lpfc_cmd = NULL;
	struct list_head *scsi_buf_list = &phba->lpfc_scsi_buf_list;
	unsigned long iflag = 0;
	spin_lock_irqsave(&phba->scsi_buf_list_lock, iflag);
	list_remove_head(scsi_buf_list, lpfc_cmd, struct lpfc_scsi_buf, list);
	if (lpfc_cmd) {
		lpfc_cmd->seg_cnt = 0;
		lpfc_cmd->nonsg_phys = 0;
		lpfc_cmd->prot_seg_cnt = 0;
	}
	spin_unlock_irqrestore(&phba->scsi_buf_list_lock, iflag);
	return  lpfc_cmd;
}