From: Aryan Sinha <sinha.aryan03@gmail.com>
To: "Rodrigo Vivi" <rodrigo.vivi@intel.com>,
"Matthew Brost" <matthew.brost@intel.com>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Cc: David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
Aryan Sinha <sinha.aryan03@gmail.com>
Subject: [PATCH v2] drm/xe: use resource_size() in xe_pagemap_create()
Date: Fri, 2 Oct 2026 13:36:59 +0530 [thread overview]
Message-ID: <20261002080731.13992-1-sinha.aryan03@gmail.com> (raw)
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
reply other threads:[~2026-10-02 8:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261002080731.13992-1-sinha.aryan03@gmail.com \
--to=sinha.aryan03@gmail.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.brost@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=simona@ffwll.ch \
--cc=thomas.hellstrom@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®