* [PATCH -next] platform/chrome: wilco_ec: Use kmemdup in enqueue_events()
@ 2019-06-21 13:59 YueHaibing
2019-06-21 14:50 ` Nick Crews
0 siblings, 1 reply; 4+ messages in thread
From: YueHaibing @ 2019-06-21 13:59 UTC (permalink / raw)
To: Benson Leung, Enric Balletbo i Serra, Nick Crews
Cc: YueHaibing, linux-kernel, kernel-janitors
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);
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH -next] platform/chrome: wilco_ec: Use kmemdup in enqueue_events()
2019-06-21 13:59 [PATCH -next] platform/chrome: wilco_ec: Use kmemdup in enqueue_events() YueHaibing
@ 2019-06-21 14:50 ` Nick Crews
2019-09-26 22:43 ` Benson Leung
0 siblings, 1 reply; 4+ messages in thread
From: Nick Crews @ 2019-06-21 14:50 UTC (permalink / raw)
To: YueHaibing
Cc: Benson Leung, Enric Balletbo i Serra, linux-kernel, kernel-janitors
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);
> }
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] platform/chrome: wilco_ec: Use kmemdup in enqueue_events()
2019-06-21 14:50 ` Nick Crews
@ 2019-09-26 22:43 ` Benson Leung
2019-09-27 17:06 ` Nick Crews
0 siblings, 1 reply; 4+ messages in thread
From: Benson Leung @ 2019-09-26 22:43 UTC (permalink / raw)
To: Nick Crews
Cc: YueHaibing, Enric Balletbo i Serra, linux-kernel, kernel-janitors
Hey Nick,
On Fri, Jun 21, 2019 at 7:51 AM Nick Crews <ncrews@chromium.org> wrote:
>
> 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);
> > }
> >
> >
> >
Looks like this was already incorporated into your commit,
platform/chrome: wilco_ec: Use kmemdup in enqueue_events().
Thanks!
Benson
--
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
bleung@google.com
Chromium OS Project
bleung@chromium.org
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] platform/chrome: wilco_ec: Use kmemdup in enqueue_events()
2019-09-26 22:43 ` Benson Leung
@ 2019-09-27 17:06 ` Nick Crews
0 siblings, 0 replies; 4+ messages in thread
From: Nick Crews @ 2019-09-27 17:06 UTC (permalink / raw)
To: Benson Leung
Cc: YueHaibing, Enric Balletbo i Serra, linux-kernel, kernel-janitors
On Thu, Sep 26, 2019 at 4:43 PM Benson Leung <bleung@chromium.org> wrote:
>
> Hey Nick,
> On Fri, Jun 21, 2019 at 7:51 AM Nick Crews <ncrews@chromium.org> wrote:
> >
> > 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);
> > > }
> > >
> > >
> > >
>
> Looks like this was already incorporated into your commit,
> platform/chrome: wilco_ec: Use kmemdup in enqueue_events().
Thanks for the note Benson, but I think that must have
been a copy pasta error, it was actually included in
"platform/chrome: wilco_ec: Add circular buffer as event queue"
just so there isn't any confusion later :)
Nick
>
> Thanks!
> Benson
>
> --
> Benson Leung
> Staff Software Engineer
> Chrome OS Kernel
> Google Inc.
> bleung@google.com
> Chromium OS Project
> bleung@chromium.org
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-09-27 17:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-21 13:59 [PATCH -next] platform/chrome: wilco_ec: Use kmemdup in enqueue_events() YueHaibing
2019-06-21 14:50 ` Nick Crews
2019-09-26 22:43 ` Benson Leung
2019-09-27 17:06 ` Nick Crews
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).