diff options
| author | Deepak R Varma <drv@mailo.com> | 2022-12-23 02:45:00 +0530 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-01-25 15:27:50 -0800 |
| commit | 81b86a10b8b69cddc7a2605274e9e75f15c9f080 (patch) | |
| tree | fdc381c62d4f0abd6ec6fe63ff2cb8ea8db3ed00 /drivers | |
| parent | 1c3aa875db9a762f9ae560ec099ad80445dc4a00 (diff) | |
| download | linux-81b86a10b8b69cddc7a2605274e9e75f15c9f080.tar.gz linux-81b86a10b8b69cddc7a2605274e9e75f15c9f080.tar.bz2 linux-81b86a10b8b69cddc7a2605274e9e75f15c9f080.zip | |
drm/amdkfd: Use resource_size() helper function
[ Upstream commit 9d086e0ddaeb08876f4df3a1485166bfd7483252 ]
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>
Stable-dep-of: 02eed83abc13 ("drm/amdkfd: fixes for HMM mem allocation")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
| -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 88bf6221d4be..2d011daf5a39 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c @@ -1038,8 +1038,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); } |
