From: Sui Jingfeng <sui.jingfeng@linux.dev>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>,
Russell King <linux+etnaviv@armlinux.org.uk>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
Thomas Zimmermann <tzimmermann@suse.de>,
Maxime Ripard <mripard@kernel.org>,
dri-devel@lists.freedesktop.org, etnaviv@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
Sui Jingfeng <sui.jingfeng@linux.dev>,
Christian Gmeiner <cgmeiner@igalia.com>
Subject: [PATCH v2 2/5] drm/etnaviv: Use 'unsigned' type to count the number of pages
Date: Sun, 8 Sep 2024 20:11:04 +0800 [thread overview]
Message-ID: <20240908121107.328740-2-sui.jingfeng@linux.dev> (raw)
In-Reply-To: <20240908121107.328740-1-sui.jingfeng@linux.dev>
The unpin_user_pages() function takes an 'unsigned long' argument to
store the number of userspace pages, and the struct drm_gem_object::size
is a size_t type. The number of pages can not be negative, hence, use
'unsigned' variable to count the number of pages.
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Signed-off-by: Sui Jingfeng <sui.jingfeng@linux.dev>
---
v2: Pick up tags and improve commit message
drivers/gpu/drm/etnaviv/etnaviv_gem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
index 5ffc31f32ac9..4ce3d2ea7767 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c
@@ -686,7 +686,7 @@ static void etnaviv_gem_userptr_release(struct etnaviv_gem_object *etnaviv_obj)
kfree(etnaviv_obj->sgt);
}
if (etnaviv_obj->pages) {
- int npages = etnaviv_obj->base.size >> PAGE_SHIFT;
+ unsigned int npages = etnaviv_obj->base.size >> PAGE_SHIFT;
unpin_user_pages(etnaviv_obj->pages, npages);
kvfree(etnaviv_obj->pages);
--
2.43.0
next prev parent reply other threads:[~2024-09-08 12:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-08 12:11 [PATCH v2 1/5] drm/etnaviv: Use unsigned type to count the number of pages Sui Jingfeng
2024-09-08 12:11 ` Sui Jingfeng [this message]
2024-09-08 12:11 ` [PATCH v2 3/5] drm/etnaviv: Drop the <linux/pm_runtime.h> header Sui Jingfeng
2024-09-08 12:11 ` [PATCH v2 4/5] drm/etnaviv: Fix missing mutex_destroy() Sui Jingfeng
2024-09-08 12:11 ` [PATCH v2 5/5] drm/etnaviv: Replace the '&pdev->dev' with 'dev' Sui Jingfeng
2024-10-28 15:54 ` [PATCH v2 1/5] drm/etnaviv: Use unsigned type to count the number of pages Lucas Stach
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=20240908121107.328740-2-sui.jingfeng@linux.dev \
--to=sui.jingfeng@linux.dev \
--cc=airlied@gmail.com \
--cc=cgmeiner@igalia.com \
--cc=christian.gmeiner@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=etnaviv@lists.freedesktop.org \
--cc=l.stach@pengutronix.de \
--cc=linux+etnaviv@armlinux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=tzimmermann@suse.de \
/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