Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sui Jingfeng and committed by
Lucas Stach
c82e8b29 56257d4c

+1 -1
+1 -1
drivers/gpu/drm/etnaviv/etnaviv_gem.c
··· 686 686 kfree(etnaviv_obj->sgt); 687 687 } 688 688 if (etnaviv_obj->pages) { 689 - int npages = etnaviv_obj->base.size >> PAGE_SHIFT; 689 + unsigned int npages = etnaviv_obj->base.size >> PAGE_SHIFT; 690 690 691 691 unpin_user_pages(etnaviv_obj->pages, npages); 692 692 kvfree(etnaviv_obj->pages);