Commit df0e16ba authored by Boshi Yu's avatar Boshi Yu Committed by Leon Romanovsky
Browse files

RDMA/erdma: Remove unnecessary __GFP_ZERO flag



The dma_alloc_coherent() interface automatically zero the memory returned.
Thus, we do not need to specify the __GFP_ZERO flag explicitly when we call
dma_alloc_coherent().

Reviewed-by: default avatarCheng Xu <chengyou@linux.alibaba.com>
Signed-off-by: default avatarBoshi Yu <boshiyu@linux.alibaba.com>
Link: https://lore.kernel.org/r/20240311113821.22482-4-boshiyu@alibaba-inc.com


Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent fdb09ed1
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -127,8 +127,7 @@ static int erdma_cmdq_cq_init(struct erdma_dev *dev)

	cq->depth = cmdq->sq.depth;
	cq->qbuf = dma_alloc_coherent(&dev->pdev->dev, cq->depth << CQE_SHIFT,
				      &cq->qbuf_dma_addr,
				      GFP_KERNEL | __GFP_ZERO);
				      &cq->qbuf_dma_addr, GFP_KERNEL);
	if (!cq->qbuf)
		return -ENOMEM;

@@ -162,8 +161,7 @@ static int erdma_cmdq_eq_init(struct erdma_dev *dev)

	eq->depth = cmdq->max_outstandings;
	eq->qbuf = dma_alloc_coherent(&dev->pdev->dev, eq->depth << EQE_SHIFT,
				      &eq->qbuf_dma_addr,
				      GFP_KERNEL | __GFP_ZERO);
				      &eq->qbuf_dma_addr, GFP_KERNEL);
	if (!eq->qbuf)
		return -ENOMEM;

+2 −4
Original line number Diff line number Diff line
@@ -87,8 +87,7 @@ int erdma_aeq_init(struct erdma_dev *dev)
	eq->depth = ERDMA_DEFAULT_EQ_DEPTH;

	eq->qbuf = dma_alloc_coherent(&dev->pdev->dev, eq->depth << EQE_SHIFT,
				      &eq->qbuf_dma_addr,
				      GFP_KERNEL | __GFP_ZERO);
				      &eq->qbuf_dma_addr, GFP_KERNEL);
	if (!eq->qbuf)
		return -ENOMEM;

@@ -237,8 +236,7 @@ static int erdma_ceq_init_one(struct erdma_dev *dev, u16 ceqn)

	eq->depth = ERDMA_DEFAULT_EQ_DEPTH;
	eq->qbuf = dma_alloc_coherent(&dev->pdev->dev, eq->depth << EQE_SHIFT,
				      &eq->qbuf_dma_addr,
				      GFP_KERNEL | __GFP_ZERO);
				      &eq->qbuf_dma_addr, GFP_KERNEL);
	if (!eq->qbuf)
		return -ENOMEM;