mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/amdkfd: Use resource_size() helper function
@ 2022-12-22 21:15 Deepak R Varma
  2023-01-07 20:09 ` Deepak R Varma
  0 siblings, 1 reply; 3+ messages in thread
From: Deepak R Varma @ 2022-12-22 21:15 UTC (permalink / raw)
  To: Felix Kuehling, Alex Deucher, Christian König, Pan, Xinhui,
	David Airlie, Daniel Vetter, amd-gfx, dri-devel, linux-kernel
  Cc: Saurabh Singh Sengar, Praveen Kumar, drv

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>
---
Note: Proposed change compile tested only.

 drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 3 +--
 1 file changed, 1 insertion(+), 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);
 	}

--
2.34.1




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdkfd: Use resource_size() helper function
  2022-12-22 21:15 [PATCH] drm/amdkfd: Use resource_size() helper function Deepak R Varma
@ 2023-01-07 20:09 ` Deepak R Varma
  2023-01-09 21:07   ` Felix Kuehling
  0 siblings, 1 reply; 3+ messages in thread
From: Deepak R Varma @ 2023-01-07 20:09 UTC (permalink / raw)
  To: Felix Kuehling, Alex Deucher, Christian König, Pan, Xinhui,
	David Airlie, Daniel Vetter, amd-gfx, dri-devel, linux-kernel
  Cc: Saurabh Singh Sengar, Praveen Kumar, Deepak R Varma

On Fri, Dec 23, 2022 at 02:45:00AM +0530, Deepak R Varma wrote:
> 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>
> ---

Hello,
Requesting a review and feedback on this patch proposal?

Thank you,
./drv




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdkfd: Use resource_size() helper function
  2023-01-07 20:09 ` Deepak R Varma
@ 2023-01-09 21:07   ` Felix Kuehling
  0 siblings, 0 replies; 3+ messages in thread
From: Felix Kuehling @ 2023-01-09 21:07 UTC (permalink / raw)
  To: Deepak R Varma, Alex Deucher, Christian König, Pan, Xinhui,
	David Airlie, Daniel Vetter, amd-gfx, dri-devel, linux-kernel
  Cc: Saurabh Singh Sengar, Praveen Kumar


Am 2023-01-07 um 15:09 schrieb Deepak R Varma:
> On Fri, Dec 23, 2022 at 02:45:00AM +0530, Deepak R Varma wrote:
>> 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>
>> ---
> Hello,
> Requesting a review and feedback on this patch proposal?

I applied the patch to amd-staging-drm-next.

Thanks,
   Felix


>
> Thank you,
> ./drv
>
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-09 21:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-22 21:15 [PATCH] drm/amdkfd: Use resource_size() helper function Deepak R Varma
2023-01-07 20:09 ` Deepak R Varma
2023-01-09 21:07   ` Felix Kuehling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®