Skip to content

Commit e8491f0

Browse files
Sui Jingfenglynxeye-dev
authored andcommitted
drm/etnaviv: Clean up etnaviv_gem_get_pages
As in the etnaviv_gem_get_pages() function, the point to the drm_device has already been cached to the 'dev' local variable. We can use it directly, While at it, using 'unsigned int' type to count the number of pages. As the drm_prime_pages_to_sg() function takes an unsigned int type for its third argument. No functional change. Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn> [lst: Reword subject to make more generic and match patch content] Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
1 parent f5cc0cb commit e8491f0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/gpu/drm/etnaviv/etnaviv_gem.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,10 @@ struct page **etnaviv_gem_get_pages(struct etnaviv_gem_object *etnaviv_obj)
100100

101101
if (!etnaviv_obj->sgt) {
102102
struct drm_device *dev = etnaviv_obj->base.dev;
103-
int npages = etnaviv_obj->base.size >> PAGE_SHIFT;
103+
unsigned int npages = etnaviv_obj->base.size >> PAGE_SHIFT;
104104
struct sg_table *sgt;
105105

106-
sgt = drm_prime_pages_to_sg(etnaviv_obj->base.dev,
107-
etnaviv_obj->pages, npages);
106+
sgt = drm_prime_pages_to_sg(dev, etnaviv_obj->pages, npages);
108107
if (IS_ERR(sgt)) {
109108
dev_err(dev->dev, "failed to allocate sgt: %ld\n",
110109
PTR_ERR(sgt));

0 commit comments

Comments
 (0)