[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240908121107.328740-2-sui.jingfeng@linux.dev>
Date: Sun, 8 Sep 2024 20:11:04 +0800
From: Sui Jingfeng <sui.jingfeng@...ux.dev>
To: Lucas Stach <l.stach@...gutronix.de>
Cc: Christian Gmeiner <christian.gmeiner@...il.com>,
Russell King <linux+etnaviv@...linux.org.uk>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
Thomas Zimmermann <tzimmermann@...e.de>,
Maxime Ripard <mripard@...nel.org>,
dri-devel@...ts.freedesktop.org,
etnaviv@...ts.freedesktop.org,
linux-kernel@...r.kernel.org,
Sui Jingfeng <sui.jingfeng@...ux.dev>,
Christian Gmeiner <cgmeiner@...lia.com>
Subject: [PATCH v2 2/5] drm/etnaviv: Use 'unsigned' type to count the number of pages
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@...lia.com>
Signed-off-by: Sui Jingfeng <sui.jingfeng@...ux.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
Powered by blists - more mailing lists