Skip to content

Commit

Permalink
drm/amdkfd: fix resource_size.cocci warnings
Browse files Browse the repository at this point in the history
Use resource_size function on resource object
instead of explicit computation.

Clean up coccicheck warning:
./drivers/gpu/drm/amd/amdkfd/kfd_migrate.c:905:10-13: ERROR: Missing
resource_size with res

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Reviewed-by: Amos Kong <kongjianjun@gmail.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Yang Li authored and Alex Deucher committed Sep 29, 2021
1 parent 335aea7 commit 0de5472
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -901,8 +901,7 @@ int svm_migrate_init(struct amdgpu_device *adev)

/* Disable SVM support capability */
pgmap->type = 0;
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);
}

Expand Down

0 comments on commit 0de5472

Please sign in to comment.