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

cgel.zte at gmail.com cgel.zte at gmail.com
Tue Sep 20 06:50:04 UTC 2022


From: ye xingchen <ye.xingchen at zte.com.cn>

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

Reported-by: Zeal Robot <zealci at zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen at zte.com.cn>
---
 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


More information about the dri-devel mailing list