2022-09-20 07:15:00

by CGEL

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

From: ye xingchen <[email protected]>

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

Reported-by: Zeal Robot <[email protected]>
Signed-off-by: ye xingchen <[email protected]>
---
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