[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADnq5_MaJhJGFZNngRWB9GFJgZUrc7qpAnnu2SeSTD5Hz-zc9g@mail.gmail.com>
Date: Thu, 19 May 2016 11:03:35 -0400
From: Alex Deucher <alexdeucher@...il.com>
To: Muhammad Falak R Wani <falakreyaz@...il.com>
Cc: David Airlie <airlied@...ux.ie>,
Nils Wallménius <nils.wallmenius@...il.com>,
Jammy Zhou <Jammy.Zhou@....com>,
LKML <linux-kernel@...r.kernel.org>,
Maling list - DRI developers
<dri-devel@...ts.freedesktop.org>,
Eric Huang <JinHuiEric.Huang@....com>,
Alex Deucher <alexander.deucher@....com>,
Rex Zhu <Rex.Zhu@....com>,
Christian König <christian.koenig@....com>
Subject: Re: [PATCH] drm/amd/powerplay/hwmgr: use kmemdup
On Thu, May 19, 2016 at 7:15 AM, Muhammad Falak R Wani
<falakreyaz@...il.com> wrote:
> Use kmemdup when some other buffer is immediately copied into allocated
> region. It replaces call to allocation followed by memcpy, by a single
> call to kmemdup.
>
> Signed-off-by: Muhammad Falak R Wani <falakreyaz@...il.com>
Applied the hwmgr patches.
Thanks!
Alex
> ---
> drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c
> index c94f9fa..1471ac3 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c
> @@ -5109,11 +5109,11 @@ static int fiji_get_pp_table(struct pp_hwmgr *hwmgr, char **table)
> struct fiji_hwmgr *data = (struct fiji_hwmgr *)(hwmgr->backend);
>
> if (!data->soft_pp_table) {
> - data->soft_pp_table = kzalloc(hwmgr->soft_pp_table_size, GFP_KERNEL);
> + data->soft_pp_table = kmemdup(hwmgr->soft_pp_table,
> + hwmgr->soft_pp_table_size,
> + GFP_KERNEL);
> if (!data->soft_pp_table)
> return -ENOMEM;
> - memcpy(data->soft_pp_table, hwmgr->soft_pp_table,
> - hwmgr->soft_pp_table_size);
> }
>
> *table = (char *)&data->soft_pp_table;
> --
> 1.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Powered by blists - more mailing lists