RDMA/erdma: Remove unnecessary __GFP_ZERO flag
authorBoshi Yu <boshiyu@linux.alibaba.com>
Mon, 11 Mar 2024 11:38:21 +0000 (19:38 +0800)
committerLeon Romanovsky <leon@kernel.org>
Mon, 1 Apr 2024 11:46:01 +0000 (14:46 +0300)
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: Cheng Xu <chengyou@linux.alibaba.com>
Signed-off-by: Boshi Yu <boshiyu@linux.alibaba.com>
Link: https://lore.kernel.org/r/20240311113821.22482-4-boshiyu@alibaba-inc.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/erdma/erdma_cmdq.c
drivers/infiniband/hw/erdma/erdma_eq.c

index 0ac2683cfccf6d6795bf202a498d1e40c0453644..43ff40b5a09d9094b05a3ca18f4b8cd410677376 100644 (file)
@@ -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;
 
index 0a4746e6d05c27f8f4d901dd73fa61ce961e48ba..84ccdd8144c9e87ab9e0b4e860b6f2213d6f4a88 100644 (file)
@@ -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;