From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: linux-media@vger.kernel.org, Sakari Ailus <sakari.ailus@iki.fi>
Subject: Re: [PATCH 1/7] v4l2-subdev.c: kvmalloc_array -> kvcalloc
Date: Mon, 9 May 2022 13:29:15 +0300 [thread overview]
Message-ID: <Ynjs++Ejru2FyBiv@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20220509091553.2637089-2-hverkuil-cisco@xs4all.nl>
Hi Hans,
Thank you for the patch.
On Mon, May 09, 2022 at 11:15:47AM +0200, Hans Verkuil wrote:
> Fixes smatch warning:
>
> drivers/media/v4l2-core/v4l2-subdev.c:978 __v4l2_subdev_state_alloc() warn: Please consider using kvcalloc instead
>
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/media/v4l2-core/v4l2-subdev.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
> index 3da200bb23dd..5c27bac772ea 100644
> --- a/drivers/media/v4l2-core/v4l2-subdev.c
> +++ b/drivers/media/v4l2-core/v4l2-subdev.c
> @@ -975,9 +975,8 @@ __v4l2_subdev_state_alloc(struct v4l2_subdev *sd, const char *lock_name,
> state->lock = &state->_lock;
>
> if (sd->entity.num_pads) {
> - state->pads = kvmalloc_array(sd->entity.num_pads,
> - sizeof(*state->pads),
> - GFP_KERNEL | __GFP_ZERO);
> + state->pads = kvcalloc(sd->entity.num_pads,
> + sizeof(*state->pads), GFP_KERNEL);
> if (!state->pads) {
> ret = -ENOMEM;
> goto err;
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2022-05-09 10:31 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 [this message]
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 ` [PATCH 3/7] videobuf2-dma-sg.c: " Hans Verkuil
2022-05-09 10:29 ` 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=Ynjs++Ejru2FyBiv@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=hverkuil-cisco@xs4all.nl \
--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.