]> git.baikalelectronics.ru Git - kernel.git/commitdiff
media: videobuf2-dma-sg.c: kvmalloc_array -> kvcalloc
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 2 May 2022 07:16:25 +0000 (09:16 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 13 May 2022 09:02:22 +0000 (11:02 +0200)
Fixes smatch warning:

drivers/media/common/videobuf2/videobuf2-dma-sg.c:129 vb2_dma_sg_alloc() warn: Please consider using kvcalloc instead

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/common/videobuf2/videobuf2-dma-sg.c

index f8a21c560ad217155c95ab7812c7067aa4f92c9c..fa69158a65b1fd2311946e7bec189e1bf4b6e35a 100644 (file)
@@ -126,8 +126,7 @@ static void *vb2_dma_sg_alloc(struct vb2_buffer *vb, struct device *dev,
         * there is no memory consistency guarantee, hence dma-sg ignores DMA
         * attributes passed from the upper layer.
         */
-       buf->pages = kvmalloc_array(buf->num_pages, sizeof(struct page *),
-                                   GFP_KERNEL | __GFP_ZERO);
+       buf->pages = kvcalloc(buf->num_pages, sizeof(struct page *), GFP_KERNEL);
        if (!buf->pages)
                goto fail_pages_array_alloc;