drm/amdkfd: Fix resource_size.cocci warning
Subsystems (3)
PATCH 1/1 drm/amdkfd: Fix resource_size.cocci warning
Use resource_size function on resource object instead of explicit computation.
Eliminate the following coccicheck warning:
./drivers/gpu/drm/amd/amdkfd/kfd_migrate.c:978:11-14: ERROR: Missing resource_size with res
Reported-by Abaci Robot <[email protected]>
Signed-off-by Yang Li <[email protected]>
--- drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c +1 -1
@@ -975,7 +975,7 @@ int svm_migrate_init(struct amdgpu_device *adev) pgmap->type =0 ;if (pgmap->type ==MEMORY_DEVICE_PRIVATE )devm_release_mem_region (adev->dev, res->start, - res->end - res->start +1 ); +resource_size (res));return PTR_ERR (r); }
Signature · 1 line
2.20.1.7.g153144c
Felix Kuehling
maintainerAm 2022-02-03 um 00:04 schrieb Yang Li:
Quoted 9 lines
Use
resource_sizefunction on resource object instead of explicit computation.Eliminate the following coccicheck warning:
./drivers/gpu/drm/amd/amdkfd/kfd_migrate.c:978:11-14: ERROR: Missingresource_sizewith resReported-by Abaci Robot <[email protected]>Signed-off-by Yang Li <[email protected]>
This patch was already applied in September: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0de5472a01804f43b7c8ddb1132bbfeb8b68674f
Which branch is this for?
Regards,
Felix
Quoted 17 lines
--- drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdkfd/kfd_migrate.c +1
-1@@ -975,7 +975,7 @@ int svm_migrate_init(struct amdgpu_device *adev) pgmap->type =0 ;if (pgmap->type ==MEMORY_DEVICE_PRIVATE )devm_release_mem_region (adev->dev, res->start, - res->end - res->start +1 ); +resource_size (res));return PTR_ERR (r); }