mirror of
https://github.com/torvalds/linux.git
synced 2026-05-22 06:01:53 +02:00
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@igalia.com> Signed-off-by: Sui Jingfeng <sui.jingfeng@linux.dev> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
This commit is contained in:
parent
56257d4c42
commit
c82e8b292c
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user