diff options
author | Sui Jingfeng <suijingfeng@loongson.cn> | 2023-06-26 17:33:31 +0300 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2023-10-11 23:52:43 +0300 |
commit | 195dd40c49ff6ee13300cb024d0e870e598621f3 (patch) | |
tree | 45aa078698b2cfd133f7d97af80a112576139bc7 /drivers/gpu | |
parent | ff5f9ae9812c7988049e0ce3c532493994e4b1f5 (diff) | |
download | linux-195dd40c49ff6ee13300cb024d0e870e598621f3.tar.xz |
drm/tegra: Remove surplus else after return
else is not generally useful after return
Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230626143331.640454-2-suijingfeng@loongson.cn
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/tegra/gem.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c index a4023163493d..11296de59c5a 100644 --- a/drivers/gpu/drm/tegra/gem.c +++ b/drivers/gpu/drm/tegra/gem.c @@ -180,15 +180,15 @@ static void *tegra_bo_mmap(struct host1x_bo *bo) struct iosys_map map; int ret; - if (obj->vaddr) { + if (obj->vaddr) return obj->vaddr; - } else if (obj->gem.import_attach) { + + if (obj->gem.import_attach) { ret = dma_buf_vmap_unlocked(obj->gem.import_attach->dmabuf, &map); return ret ? NULL : map.vaddr; - } else { - return vmap(obj->pages, obj->num_pages, VM_MAP, - pgprot_writecombine(PAGE_KERNEL)); } + + return vmap(obj->pages, obj->num_pages, VM_MAP, pgprot_writecombine(PAGE_KERNEL)); } static void tegra_bo_munmap(struct host1x_bo *bo, void *addr) @@ -198,10 +198,11 @@ static void tegra_bo_munmap(struct host1x_bo *bo, void *addr) if (obj->vaddr) return; - else if (obj->gem.import_attach) - dma_buf_vunmap_unlocked(obj->gem.import_attach->dmabuf, &map); - else - vunmap(addr); + + if (obj->gem.import_attach) + return dma_buf_vunmap_unlocked(obj->gem.import_attach->dmabuf, &map); + + vunmap(addr); } static struct host1x_bo *tegra_bo_get(struct host1x_bo *bo) |