All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
To: linux-media@vger.kernel.org
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Sakari Ailus <sakari.ailus@iki.fi>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>
Subject: [PATCH 3/7] videobuf2-dma-sg.c: kvmalloc_array -> kvcalloc
Date: Mon,  9 May 2022 11:15:49 +0200	[thread overview]
Message-ID: <20220509091553.2637089-4-hverkuil-cisco@xs4all.nl> (raw)
In-Reply-To: <20220509091553.2637089-1-hverkuil-cisco@xs4all.nl>

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>
---
 drivers/media/common/videobuf2/videobuf2-dma-sg.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/common/videobuf2/videobuf2-dma-sg.c b/drivers/media/common/videobuf2/videobuf2-dma-sg.c
index f8a21c560ad2..fa69158a65b1 100644
--- a/drivers/media/common/videobuf2/videobuf2-dma-sg.c
+++ b/drivers/media/common/videobuf2/videobuf2-dma-sg.c
@@ -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;
 
-- 
2.34.1


  parent reply	other threads:[~2022-05-09  9:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-09  9:15 [PATCH 0/7] Various smatch fixes Hans Verkuil
2022-05-09  9:15 ` [PATCH 1/7] v4l2-subdev.c: kvmalloc_array -> kvcalloc Hans Verkuil
2022-05-09 10:29   ` Laurent Pinchart
2022-05-09  9:15 ` [PATCH 2/7] v4l2-ctls-core.c: " Hans Verkuil
2022-05-09 10:29   ` Laurent Pinchart
2022-05-09  9:15 ` Hans Verkuil [this message]
2022-05-09 10:29   ` [PATCH 3/7] videobuf2-dma-sg.c: " Laurent Pinchart
2022-05-09  9:15 ` [PATCH 4/7] cx25821: request_irq -> devm_request_irq Hans Verkuil
2022-05-09  9:15 ` [PATCH 5/7] ccs-core.c: fix failure to call clk_disable_unprepare Hans Verkuil
2022-05-09  9:15 ` [PATCH 6/7] s5k6a3: add missing clk_disable_unprepare Hans Verkuil
2022-05-09  9:15 ` [PATCH 7/7] uvc_v4l2.c: avoid using iterator used outside loop Hans Verkuil
2022-05-09 10:04   ` Sakari Ailus
2022-05-09 10:09   ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220509091553.2637089-4-hverkuil-cisco@xs4all.nl \
    --to=hverkuil-cisco@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.