linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Crews <ncrews@chromium.org>
To: YueHaibing <yuehaibing@huawei.com>
Cc: Benson Leung <bleung@chromium.org>,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH -next] platform/chrome: wilco_ec: Use kmemdup in enqueue_events()
Date: Fri, 21 Jun 2019 08:50:57 -0600	[thread overview]
Message-ID: <CAHX4x86qUKPTkRFWvWMgTMh1VY8ogJfr55khsSJTakS0emiyFA@mail.gmail.com> (raw)
In-Reply-To: <20190621135907.112232-1-yuehaibing@huawei.com>

Thanks Yue, looks good to me.

Nick

On Fri, Jun 21, 2019 at 7:59 AM YueHaibing <yuehaibing@huawei.com> wrote:
>
> Use kmemdup rather than duplicating its implementation
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/platform/chrome/wilco_ec/event.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/platform/chrome/wilco_ec/event.c b/drivers/platform/chrome/wilco_ec/event.c
> index c975b76e6255..70156e75047e 100644
> --- a/drivers/platform/chrome/wilco_ec/event.c
> +++ b/drivers/platform/chrome/wilco_ec/event.c
> @@ -248,10 +248,9 @@ static int enqueue_events(struct acpi_device *adev, const u8 *buf, u32 length)
>                 offset += event_size;
>
>                 /* Copy event into the queue */
> -               queue_event = kzalloc(event_size, GFP_KERNEL);
> +               queue_event = kmemdup(event, event_size, GFP_KERNEL);
>                 if (!queue_event)
>                         return -ENOMEM;
> -               memcpy(queue_event, event, event_size);
>                 event_queue_push(dev_data->events, queue_event);
>         }
>
>
>

  reply	other threads:[~2019-06-21 14:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-21 13:59 [PATCH -next] platform/chrome: wilco_ec: Use kmemdup in enqueue_events() YueHaibing
2019-06-21 14:50 ` Nick Crews [this message]
2019-09-26 22:43   ` Benson Leung
2019-09-27 17:06     ` Nick Crews

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=CAHX4x86qUKPTkRFWvWMgTMh1VY8ogJfr55khsSJTakS0emiyFA@mail.gmail.com \
    --to=ncrews@chromium.org \
    --cc=bleung@chromium.org \
    --cc=enric.balletbo@collabora.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yuehaibing@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).