Skip to content

Commit 56257d4

Browse files
suijingfenglynxeye-dev
authored andcommitted
drm/etnaviv: Use unsigned type to count the number of pages
The drm_prime_pages_to_sg() function takes an 'unsigned int' argument to store the length of the page vector. The size of the object in number of CPU pages can not be negative, hence, use 'unsigned' variable to store the number of pages, instead of the 'signed' one. Reviewed-by: Christian Gmeiner <[email protected]> Signed-off-by: Sui Jingfeng <[email protected]> Signed-off-by: Lucas Stach <[email protected]>
1 parent 13c96ac commit 56257d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ static struct lock_class_key etnaviv_prime_lock_class;
1717
struct sg_table *etnaviv_gem_prime_get_sg_table(struct drm_gem_object *obj)
1818
{
1919
struct etnaviv_gem_object *etnaviv_obj = to_etnaviv_bo(obj);
20-
int npages = obj->size >> PAGE_SHIFT;
20+
unsigned int npages = obj->size >> PAGE_SHIFT;
2121

2222
if (WARN_ON(!etnaviv_obj->pages)) /* should have already pinned! */
2323
return ERR_PTR(-EINVAL);

0 commit comments

Comments
 (0)