Commit e619190e authored by Weili Qian's avatar Weili Qian Committed by JiangShui
Browse files

crypto: hisilicon/qm - remove duplicate configurations

driver inclusion
category: cleanup
bugzilla: https://gitee.com/openeuler/kernel/issues/I8LFYK


CVE: NA

----------------------------------------------------------------------

Some operations in function are duplicate. Remove these duplicate
configurations to simplify the code.

Signed-off-by: default avatarWeili Qian <qianweili@huawei.com>
Signed-off-by: default avatarJiangShui Yang <yangjiangshui@h-partners.com>
parent 301a21d7
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -1924,7 +1924,6 @@ static struct hisi_qp *qm_create_qp_nolock(struct hisi_qm *qm, u8 alg_type)

	qp->event_cb = NULL;
	qp->req_cb = NULL;
	qp->qp_id = qp_id;
	qp->alg_type = alg_type;
	qp->is_in_kernel = true;
	qm->qp_in_used++;
@@ -1991,10 +1990,10 @@ static int qm_sq_ctx_cfg(struct hisi_qp *qp, int qp_id, u32 pasid)
		sqc.dw3 = cpu_to_le32(QM_MK_SQC_DW3_V2(qm->sqe_size, qp->sq_depth));
		sqc.w8 = 0; /* rand_qc */
	}
	sqc.cq_num = cpu_to_le16(qp_id);
	sqc.w13 = cpu_to_le16(QM_MK_SQC_W13(0, 1, qp->alg_type));
	sqc.base_l = cpu_to_le32(lower_32_bits(qp->sqe_dma));
	sqc.base_h = cpu_to_le32(upper_32_bits(qp->sqe_dma));
	sqc.cq_num = cpu_to_le16(qp_id);
	sqc.pasid = cpu_to_le16(pasid);

	if (ver >= QM_HW_V3 && qm->use_sva && !qp->is_in_kernel)
@@ -2010,12 +2009,8 @@ static int qm_cq_ctx_cfg(struct hisi_qp *qp, int qp_id, u32 pasid)
	enum qm_hw_ver ver = qm->ver;
	struct qm_cqc cqc = {0};

	cqc.base_l = cpu_to_le32(lower_32_bits(qp->cqe_dma));
	cqc.base_h = cpu_to_le32(upper_32_bits(qp->cqe_dma));
	cqc.pasid = cpu_to_le16(pasid);
	if (ver == QM_HW_V1) {
		cqc.dw3 = cpu_to_le32(QM_MK_CQC_DW3_V1(0, 0, 0,
							QM_QC_CQE_SIZE));
		cqc.dw3 = cpu_to_le32(QM_MK_CQC_DW3_V1(0, 0, 0, QM_QC_CQE_SIZE));
		cqc.w8 = cpu_to_le16(qp->cq_depth - 1);
	} else {
		cqc.dw3 = cpu_to_le32(QM_MK_CQC_DW3_V2(QM_QC_CQE_SIZE, qp->cq_depth));