All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
To: Jinjie Ruan <ruanjinjie@huawei.com>,
	mchehab@kernel.org, linux-media@vger.kernel.org
Subject: Re: [PATCH -next v3 1/2] media: cx231xx: Switch to use kmemdup() helper
Date: Fri, 8 Sep 2023 14:19:17 +0200	[thread overview]
Message-ID: <fe386ce3-c1ee-2940-059a-a8705d200d01@collabora.com> (raw)
In-Reply-To: <20230903081440.1564633-2-ruanjinjie@huawei.com>

Hi,

W dniu 3.09.2023 o 10:14, Jinjie Ruan pisze:
> Use kmemdup() helper instead of open-coding to
> simplify the code.
> 
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>

I have already reviewed this before, you can add my

Reviewed-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>

> ---
> v2:
> - Adjust use kmemdup() helper to be the first patch as suggested.
> ---
>   drivers/media/usb/cx231xx/cx231xx-core.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/media/usb/cx231xx/cx231xx-core.c b/drivers/media/usb/cx231xx/cx231xx-core.c
> index 727e6268567f..746727ea1a4c 100644
> --- a/drivers/media/usb/cx231xx/cx231xx-core.c
> +++ b/drivers/media/usb/cx231xx/cx231xx-core.c
> @@ -751,10 +751,9 @@ int cx231xx_ep5_bulkout(struct cx231xx *dev, u8 *firmware, u16 size)
>   	int ret = -ENOMEM;
>   	u32 *buffer;
>   
> -	buffer = kzalloc(4096, GFP_KERNEL);
> +	buffer = kmemdup(firmware, 4096, GFP_KERNEL);
>   	if (buffer == NULL)
>   		return -ENOMEM;
> -	memcpy(&buffer[0], firmware, 4096);
>   
>   	ret = usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 5),
>   			buffer, 4096, &actlen, 2000);


  reply	other threads:[~2023-09-08 12:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-03  8:14 [PATCH -next v3 0/2] media: cx231xx: Switch to use kmemdup() helper and add two macros Jinjie Ruan
2023-09-03  8:14 ` [PATCH -next v3 1/2] media: cx231xx: Switch to use kmemdup() helper Jinjie Ruan
2023-09-08 12:19   ` Andrzej Pietrasiewicz [this message]
2023-09-09  7:29     ` Ruan Jinjie
2023-09-03  8:14 ` [PATCH -next v3 2/2] media: cx231xx: Add EP5_BUF_SIZE and EP5_TIMEOUT_MS macros Jinjie Ruan
2023-09-08 12:26   ` Andrzej Pietrasiewicz
2023-09-09  7:30     ` Ruan Jinjie

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=fe386ce3-c1ee-2940-059a-a8705d200d01@collabora.com \
    --to=andrzej.p@collabora.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=ruanjinjie@huawei.com \
    /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.