diff options
author | Deepak R Varma <drv@mailo.com> | 2022-12-23 00:15:00 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2023-01-11 02:04:24 +0300 |
commit | 9d086e0ddaeb08876f4df3a1485166bfd7483252 (patch) | |
tree | afb9eb43875bdd0a92c95696175c18d977777982 /drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | |
parent | 40794dfd20e08118fc1a4fd6d3d885fc65cdda43 (diff) | |
download | linux-9d086e0ddaeb08876f4df3a1485166bfd7483252.tar.xz |
drm/amdkfd: Use resource_size() helper function
Use the resource_size() function instead of a open coded computation
resource size. It makes the code more readable.
Issue identified using resource_size.cocci coccinelle semantic patch.
Signed-off-by: Deepak R Varma <drv@mailo.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_migrate.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c index 10048ce16aea..de8ce72344fc 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c @@ -1027,8 +1027,7 @@ int svm_migrate_init(struct amdgpu_device *adev) /* Disable SVM support capability */ pgmap->type = 0; if (pgmap->type == MEMORY_DEVICE_PRIVATE) - devm_release_mem_region(adev->dev, res->start, - res->end - res->start + 1); + devm_release_mem_region(adev->dev, res->start, resource_size(res)); return PTR_ERR(r); } |