<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Sure. </p>
<p style="margin-top:0;margin-bottom:0">Thanks.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Best Regards</p>
<p style="margin-top:0;margin-bottom:0">Rex</p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Christian König <ckoenig.leichtzumerken@gmail.com><br>
<b>Sent:</b> Monday, March 12, 2018 8:54 PM<br>
<b>To:</b> Zhu, Rex; amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> Re: [PATCH 2/4] drm/amdgpu: Plus NULL function pointer check</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Am 12.03.2018 um 13:34 schrieb Rex Zhu:<br>
> Change-Id: Ifd6553646e7468bc935504075816074373e1d58d<br>
> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com><br>
> ---<br>
>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 +++++++-----<br>
>   1 file changed, 7 insertions(+), 5 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
> index 56b2245..d60ecc5 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
> @@ -1415,12 +1415,14 @@ static int amdgpu_device_ip_late_set_cg_state(struct amdgpu_device *adev)<br>
>                if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD &&<br>
>                    adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE) {<br>
>                        /* enable clockgating to save power */<br>
> -                     r = adev->ip_blocks[i].version->funcs->set_clockgating_state((void *)adev,<br>
> +                     if (adev->ip_blocks[i].version->funcs->set_clockgating_state) {<br>
<br>
Why not add it to the if check above?<br>
<br>
Christian.<br>
<br>
> +                             r = adev->ip_blocks[i].version->funcs->set_clockgating_state((void *)adev,<br>
>                                                                                     AMD_CG_STATE_GATE);<br>
> -                     if (r) {<br>
> -                             DRM_ERROR("set_clockgating_state(gate) of IP block <%s> failed %d\n",<br>
> -                                       adev->ip_blocks[i].version->funcs->name, r);<br>
> -                             return r;<br>
> +                             if (r) {<br>
> +                                     DRM_ERROR("set_clockgating_state(gate) of IP block <%s> failed %d\n",<br>
> +                                             adev->ip_blocks[i].version->funcs->name, r);<br>
> +                                     return r;<br>
> +                             }<br>
>                        }<br>
>                }<br>
>        }<br>
<br>
</div>
</span></font></div>
</div>
</div>
</body>
</html>