* [PATCH -next] drm/amdkfd: Fix resource_size.cocci warning
@ 2022-02-03 5:04 Yang Li
2022-02-03 17:19 ` Felix Kuehling
0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2022-02-03 5:04 UTC (permalink / raw)
To: daniel
Cc: airlied, Felix.Kuehling, Xinhui.Pan, Abaci Robot, linux-kernel,
amd-gfx, Yang Li, dri-devel, alexander.deucher, christian.koenig
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 <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
index 8430f6475723..d4287a39be56 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
@@ -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);
}
--
2.20.1.7.g153144c
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] drm/amdkfd: Fix resource_size.cocci warning
2022-02-03 5:04 [PATCH -next] drm/amdkfd: Fix resource_size.cocci warning Yang Li
@ 2022-02-03 17:19 ` Felix Kuehling
0 siblings, 0 replies; 2+ messages in thread
From: Felix Kuehling @ 2022-02-03 17:19 UTC (permalink / raw)
To: Yang Li, daniel
Cc: airlied, Xinhui.Pan, Abaci Robot, linux-kernel, dri-devel,
amd-gfx, alexander.deucher, christian.koenig
Am 2022-02-03 um 00:04 schrieb Yang Li:
> 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 <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
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
> ---
> drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
> index 8430f6475723..d4287a39be56 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
> @@ -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);
> }
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-03 17:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-03 5:04 [PATCH -next] drm/amdkfd: Fix resource_size.cocci warning Yang Li
2022-02-03 17:19 ` Felix Kuehling
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).