diff options
author | Sui Jingfeng <suijingfeng@loongson.cn> | 2023-10-02 19:12:07 +0800 |
---|---|---|
committer | Lucas Stach <l.stach@pengutronix.de> | 2024-01-23 10:20:20 +0100 |
commit | e8491f0238625b156e2d82c49fd8c838352b7e74 (patch) | |
tree | 51610dc89ffdae668d2eb17aa7193a6337566904 /drivers/gpu/drm/etnaviv | |
parent | f5cc0cbc2796627d8b9c561a8e135fe34615b654 (diff) | |
download | linux-e8491f0238625b156e2d82c49fd8c838352b7e74.tar.gz linux-e8491f0238625b156e2d82c49fd8c838352b7e74.tar.bz2 linux-e8491f0238625b156e2d82c49fd8c838352b7e74.zip |
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>
Diffstat (limited to 'drivers/gpu/drm/etnaviv')
-rw-r--r-- | drivers/gpu/drm/etnaviv/etnaviv_gem.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c index be2f459c66b5..71a6d2b1c80f 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c @@ -100,11 +100,10 @@ struct page **etnaviv_gem_get_pages(struct etnaviv_gem_object *etnaviv_obj) if (!etnaviv_obj->sgt) { struct drm_device *dev = etnaviv_obj->base.dev; - int npages = etnaviv_obj->base.size >> PAGE_SHIFT; + unsigned int npages = etnaviv_obj->base.size >> PAGE_SHIFT; struct sg_table *sgt; - sgt = drm_prime_pages_to_sg(etnaviv_obj->base.dev, - etnaviv_obj->pages, npages); + sgt = drm_prime_pages_to_sg(dev, etnaviv_obj->pages, npages); if (IS_ERR(sgt)) { dev_err(dev->dev, "failed to allocate sgt: %ld\n", PTR_ERR(sgt)); |