* [PATCH v2] drm/xe: use resource_size() in xe_pagemap_create()
@ 2026-10-02 8:06 Aryan Sinha
0 siblings, 0 replies; only message in thread
From: Aryan Sinha @ 2026-10-02 8:06 UTC (permalink / raw)
To: Rodrigo Vivi, Matthew Brost, Thomas Hellström
Cc: David Airlie, Simona Vetter, intel-xe, dri-devel, linux-kernel,
Aryan Sinha
Use resource_size() instead of open coding res->end - res->start + 1.
Include linux/ioport.h explicitly, since the file relies on struct
resource and now on the helper as well.
Signed-off-by: Aryan Sinha <sinha.aryan03@gmail.com>
---
v2: elaborate more in the commit message, and include
linux/ioport.h. Both as per Rodrigo suggestions.
Link to v1: https://lore.kernel.org/all/20261001163328.51556-1-sinha.aryan03@gmail.com/
drivers/gpu/drm/xe/xe_svm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_svm.c b/drivers/gpu/drm/xe/xe_svm.c
index b228a737c..a9b087c43 100644
--- a/drivers/gpu/drm/xe/xe_svm.c
+++ b/drivers/gpu/drm/xe/xe_svm.c
@@ -3,6 +3,7 @@
* Copyright © 2024 Intel Corporation
*/
+#include <linux/ioport.h>
#include <linux/pci-p2pdma.h>
#include <drm/drm_drv.h>
@@ -1848,7 +1849,7 @@ static struct xe_pagemap *xe_pagemap_create(struct xe_device *xe, struct xe_vram
out_no_pages:
drm_pagemap_release_owner(&xpagemap->peer);
out_no_owner:
- devm_release_mem_region(dev, res->start, res->end - res->start + 1);
+ devm_release_mem_region(dev, res->start, resource_size(res));
out_err:
drm_pagemap_put(dpagemap);
return ERR_PTR(err);
--
2.46.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-02 8:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-02 8:06 [PATCH v2] drm/xe: use resource_size() in xe_pagemap_create() Aryan Sinha
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®