<div dir="ltr"><div dir="ltr">On Sun, Sep 26, 2021 at 3:17 PM Yang Li <<a href="mailto:yang.lee@linux.alibaba.com">yang.lee@linux.alibaba.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Use resource_size function on resource object<br>
instead of explicit computation.<br>
<br>
Clean up coccicheck warning:<br>
./drivers/gpu/drm/amd/amdkfd/kfd_migrate.c:905:10-13: ERROR: Missing<br>
resource_size with res<br>
<br>
Reported-by: Abaci Robot <<a href="mailto:abaci@linux.alibaba.com" target="_blank">abaci@linux.alibaba.com</a>><br>
Signed-off-by: Yang Li <<a href="mailto:yang.lee@linux.alibaba.com" target="_blank">yang.lee@linux.alibaba.com</a>><br>
---<br>
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 3 +--<br>
1 file changed, 1 insertion(+), 2 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c<br>
index 4a16e3c..f53e17a 100644<br>
--- a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c<br>
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c<br>
@@ -901,8 +901,7 @@ int svm_migrate_init(struct amdgpu_device *adev)<br>
<br>
/* Disable SVM support capability */<br>
pgmap->type = 0;<br>
- devm_release_mem_region(adev->dev, res->start,<br>
- res->end - res->start + 1);<br>
+ devm_release_mem_region(adev->dev, res->start, resource_size(res));<br></blockquote><div><br></div><div>Looks good.</div><div>Reviewed-by: Amos Kong <<a href="mailto:kongjianjun@gmail.com">kongjianjun@gmail.com</a>></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
return PTR_ERR(r);<br>
}<br>
<br>
-- <br>
1.8.3.1<br>
<br>
</blockquote></div></div>