From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752840AbcG2TlT (ORCPT ); Fri, 29 Jul 2016 15:41:19 -0400 Received: from mail-yw0-f179.google.com ([209.85.161.179]:33111 "EHLO mail-yw0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751529AbcG2TlI (ORCPT ); Fri, 29 Jul 2016 15:41:08 -0400 MIME-Version: 1.0 In-Reply-To: References: <1469722697-15220-1-git-send-email-weiyj.lk@gmail.com> From: Sean Paul Date: Fri, 29 Jul 2016 15:40:48 -0400 Message-ID: Subject: Re: [PATCH -next] drm/amdgpu: use kmemdup rather than duplicating its implementation To: "Deucher, Alexander" Cc: Wei Yongjun , "Koenig, Christian" , Dave Airlie , "Jiang, Sonny" , "Liu, Leo" , "Nath, Arindam" , "Zhou, David(ChunMing)" , "Zhou, Jammy" , "Liu, Monk" , dri-devel , Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 29, 2016 at 3:38 PM, Deucher, Alexander wrote: >> -----Original Message----- >> From: Sean Paul [mailto:seanpaul@google.com] >> Sent: Friday, July 29, 2016 3:35 PM >> To: Wei Yongjun >> Cc: Deucher, Alexander; Koenig, Christian; Dave Airlie; Jiang, Sonny; Liu, Leo; >> Nath, Arindam; Zhou, David(ChunMing); Zhou, Jammy; Liu, Monk; dri-devel; >> Linux Kernel Mailing List >> Subject: Re: [PATCH -next] drm/amdgpu: use kmemdup rather than >> duplicating its implementation >> >> On Thu, Jul 28, 2016 at 12:18 PM, Wei Yongjun wrote: >> > Use kmemdup rather than duplicating its implementation. >> > >> > Generated by: scripts/coccinelle/api/memdup.cocci >> > >> > Signed-off-by: Wei Yongjun >> >> >> Thanks for the patch. I'll apply this to -misc once the merge window is closed. >> >> Acked-by: Sean Paul > > Unless you've already applied this to the misc tree, I'd prefer to take it via the amdgpu tree. > Nope, it's all yours. Sean > Alex > >> >> >> > --- >> > drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 4 +--- >> > 1 file changed, 1 insertion(+), 3 deletions(-) >> > >> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c >> b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c >> > index a46a64c..b779b5f 100644 >> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c >> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c >> > @@ -296,12 +296,10 @@ int amdgpu_uvd_suspend(struct amdgpu_device >> *adev) >> > size = amdgpu_bo_size(adev->uvd.vcpu_bo); >> > ptr = adev->uvd.cpu_addr; >> > >> > - adev->uvd.saved_bo = kmalloc(size, GFP_KERNEL); >> > + adev->uvd.saved_bo = kmemdup(ptr, size, GFP_KERNEL); >> > if (!adev->uvd.saved_bo) >> > return -ENOMEM; >> > >> > - memcpy(adev->uvd.saved_bo, ptr, size); >> > - >> > return 0; >> > } >> > >> > >> > >> >