]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
media: ipu3-cio2: Use dma_zalloc_coherent to replace dma_alloc_coherent + memset
authorzhong jiang <zhongjiang@huawei.com>
Sat, 18 Aug 2018 15:16:54 +0000 (11:16 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 31 Aug 2018 13:24:33 +0000 (09:24 -0400)
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@huawei.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/pci/intel/ipu3/ipu3-cio2.c

index 29027159eced88a57b9a39feba4197e45c1a2d00..f0c6374ee58ef293800c5b61fb13f412ed2c49a0 100644 (file)
@@ -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;
 }