From: Andi Shyti <andi.shyti@linux.intel.com>
To: intel-gfx <intel-gfx@lists.freedesktop.org>,
dri-devel <dri-devel@lists.freedesktop.org>
Cc: Krzysztof Niemiec <krzysztof.niemiec@intel.com>,
Chris Wilson <chris.p.wilson@linux.intel.com>,
Andi Shyti <andi.shyti@linux.intel.com>
Subject: [PATCH] drm/i915/gem: Remove unnecessary cast
Date: Wed, 14 Aug 2024 19:59:47 +0200 [thread overview]
Message-ID: <20240814175947.169590-1-andi.shyti@linux.intel.com> (raw)
The cast from "long" to "unsigned long" is unnecessary. Remove
it.
In this case, the variables "start" and "end" are of type long
because they need to account for the possibility of negative
values. However, they are subsequently moved to "unsigned long"
since addresses are typically handled as unsigned values.
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
---
drivers/gpu/drm/i915/gem/i915_gem_mman.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
index e9b2424156f0..80528ba90a56 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
@@ -323,8 +323,8 @@ static void set_address_limits(struct vm_area_struct *area,
end = min_t(long, end, vm_end);
/* Let's move back into the "<< PAGE_SHIFT" domain */
- *start_vaddr = (unsigned long)start << PAGE_SHIFT;
- *end_vaddr = (unsigned long)end << PAGE_SHIFT;
+ *start_vaddr = start << PAGE_SHIFT;
+ *end_vaddr = end << PAGE_SHIFT;
*pfn = (gmadr_start + i915_ggtt_offset(vma)) >> PAGE_SHIFT;
*pfn += (*start_vaddr - area->vm_start) >> PAGE_SHIFT;
--
2.45.2
next reply other threads:[~2024-08-14 18:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-14 17:59 Andi Shyti [this message]
2024-08-14 18:51 ` ✗ Fi.CI.BAT: failure for drm/i915/gem: Remove unnecessary cast Patchwork
2024-08-14 21:41 ` ✓ Fi.CI.BAT: success for drm/i915/gem: Remove unnecessary cast (rev2) Patchwork
2024-08-15 18:58 ` [PATCH] drm/i915/gem: Remove unnecessary cast Rodrigo Vivi
2024-08-16 8:20 ` Andi Shyti
2024-08-23 13:37 ` Rodrigo Vivi
2024-08-16 5:15 ` ✗ Fi.CI.IGT: failure for drm/i915/gem: Remove unnecessary cast (rev2) Patchwork
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=20240814175947.169590-1-andi.shyti@linux.intel.com \
--to=andi.shyti@linux.intel.com \
--cc=chris.p.wilson@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=krzysztof.niemiec@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