[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1534605415-11452-2-git-send-email-zhongjiang@huawei.com>
Date: Sat, 18 Aug 2018 23:16:54 +0800
From: zhong jiang <zhongjiang@...wei.com>
To: <yong.zhi@...el.com>, <sakari.ailus@...ux.intel.com>,
<bingbu.cao@...el.com>, <mchehab@...nel.org>,
<matthias.bgg@...il.com>
CC: <tian.shu.qiu@...el.com>, <jian.xu.zheng@...el.com>,
<linux-kernel@...r.kernel.org>, <linux-media@...r.kernel.org>
Subject: [PATCH 1/2] media: ipu3-cio2: Use dma_zalloc_coherent to replace dma_alloc_coherent + memset
dma_zalloc_coherent has implemented the dma_alloc_coherent() + memset(),
We prefer to dma_zalloc_coherent instead of open-codeing.
Signed-off-by: zhong jiang <zhongjiang@...wei.com>
---
drivers/media/pci/intel/ipu3/ipu3-cio2.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
index 2902715..f0c6374 100644
--- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c
+++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
@@ -218,13 +218,11 @@ static int cio2_fbpt_init(struct cio2_device *cio2, struct cio2_queue *q)
{
struct device *dev = &cio2->pci_dev->dev;
- q->fbpt = dma_alloc_coherent(dev, CIO2_FBPT_SIZE, &q->fbpt_bus_addr,
- GFP_KERNEL);
+ q->fbpt = dma_zalloc_coherent(dev, CIO2_FBPT_SIZE, &q->fbpt_bus_addr,
+ GFP_KERNEL);
if (!q->fbpt)
return -ENOMEM;
- memset(q->fbpt, 0, CIO2_FBPT_SIZE);
-
return 0;
}
--
1.7.12.4
Powered by blists - more mailing lists