diff mbox

drm/virtio: remove not needed 'ret' var

Message ID 20170409235857.7828-1-gustavo@padovan.org (mailing list archive)
State New, archived
Headers show

Commit Message

Gustavo Padovan April 9, 2017, 11:58 p.m. UTC
From: Gustavo Padovan <gustavo.padovan@collabora.com>

virtio_gpu_cursor_plane_update() doesn't need to know the exact
value of virtio_gpu_object_reserve() return, just if it is zero or
not. Thus just use the function direct in the return.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
---
 drivers/gpu/drm/virtio/virtgpu_plane.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c
index adcdbd0..76d5fed 100644
--- a/drivers/gpu/drm/virtio/virtgpu_plane.c
+++ b/drivers/gpu/drm/virtio/virtgpu_plane.c
@@ -197,7 +197,6 @@  static void virtio_gpu_cursor_plane_update(struct drm_plane *plane,
 	struct virtio_gpu_fence *fence = NULL;
 	struct virtio_gpu_object *bo = NULL;
 	uint32_t handle;
-	int ret = 0;
 
 	if (plane->state->crtc)
 		output = drm_crtc_to_virtio_gpu_output(plane->state->crtc);
@@ -221,8 +220,7 @@  static void virtio_gpu_cursor_plane_update(struct drm_plane *plane,
 			 cpu_to_le32(plane->state->crtc_w),
 			 cpu_to_le32(plane->state->crtc_h),
 			 0, 0, &fence);
-		ret = virtio_gpu_object_reserve(bo, false);
-		if (!ret) {
+		if (!virtio_gpu_object_reserve(bo, false)) {
 			reservation_object_add_excl_fence(bo->tbo.resv,
 							  &fence->f);
 			dma_fence_put(&fence->f);