Sure. Thanks.
Best Regards Rex ________________________________ From: Christian König <ckoenig.leichtzumer...@gmail.com> Sent: Monday, March 12, 2018 8:54 PM To: Zhu, Rex; amd-gfx@lists.freedesktop.org Subject: Re: [PATCH 2/4] drm/amdgpu: Plus NULL function pointer check Am 12.03.2018 um 13:34 schrieb Rex Zhu: > Change-Id: Ifd6553646e7468bc935504075816074373e1d58d > Signed-off-by: Rex Zhu <rex....@amd.com> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > index 56b2245..d60ecc5 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > @@ -1415,12 +1415,14 @@ static int amdgpu_device_ip_late_set_cg_state(struct > amdgpu_device *adev) > if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD > && > adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE) > { > /* enable clockgating to save power */ > - r = > adev->ip_blocks[i].version->funcs->set_clockgating_state((void *)adev, > + if > (adev->ip_blocks[i].version->funcs->set_clockgating_state) { Why not add it to the if check above? Christian. > + r = > adev->ip_blocks[i].version->funcs->set_clockgating_state((void *)adev, > > AMD_CG_STATE_GATE); > - if (r) { > - DRM_ERROR("set_clockgating_state(gate) of IP > block <%s> failed %d\n", > - > adev->ip_blocks[i].version->funcs->name, r); > - return r; > + if (r) { > + DRM_ERROR("set_clockgating_state(gate) > of IP block <%s> failed %d\n", > + > adev->ip_blocks[i].version->funcs->name, r); > + return r; > + } > } > } > }
_______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx