/* This routine is to free all the pending completion-queue events to the back into the free pool for device reset.  */
static void lpfc_sli4_cq_event_release_all(struct lpfc_hba *)
/* This routine is to free all the pending completion-queue events to the back into the free pool for device reset.  */
static void lpfc_sli4_cq_event_release_all(struct lpfc_hba *)
{
	LIST_HEAD(cqelist);
	struct lpfc_cq_event *cqe;
	unsigned long iflags;
	spin_lock_irqsave(&phba->hbalock, iflags);
	list_splice_init(&phba->sli4_hba.sp_fcp_xri_aborted_work_queue,
			 &cqelist);
	list_splice_init(&phba->sli4_hba.sp_els_xri_aborted_work_queue,
			 &cqelist);
	list_splice_init(&phba->sli4_hba.sp_asynce_work_queue,
			 &cqelist);
	spin_unlock_irqrestore(&phba->hbalock, iflags);
	while (!list_empty(&cqelist)) {
		list_remove_head(&cqelist, cqe, struct lpfc_cq_event, list);
		lpfc_sli4_cq_event_release(phba, cqe);
	}
}