[PATCH linux-next] drm/vmwgfx: Remove the unneeded result variable

From: cgel . zte
Date: Tue Sep 20 2022 - 02:50:14 EST


From: ye xingchen <ye.xingchen@xxxxxxxxxx>

Return the value ttm_pool_alloc() directly instead of storing it in
another redundant variable.

Reported-by: Zeal Robot <zealci@xxxxxxxxxx>
Signed-off-by: ye xingchen <ye.xingchen@xxxxxxxxxx>
---
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
index 4e3938e62c08..f17e0da7475d 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
@@ -470,15 +470,11 @@ static void vmw_ttm_destroy(struct ttm_device *bdev, struct ttm_tt *ttm)
static int vmw_ttm_populate(struct ttm_device *bdev,
struct ttm_tt *ttm, struct ttm_operation_ctx *ctx)
{
- int ret;
-
/* TODO: maybe completely drop this ? */
if (ttm_tt_is_populated(ttm))
return 0;

- ret = ttm_pool_alloc(&bdev->pool, ttm, ctx);
-
- return ret;
+ return ttm_pool_alloc(&bdev->pool, ttm, ctx);
}

static void vmw_ttm_unpopulate(struct ttm_device *bdev,
--
2.25.1