[Mesa-dev] [PATCH 13/15] winsys/virgl: remove temporary ret variable

Emil Velikov emil.l.velikov at gmail.com
Thu Oct 29 04:59:44 PDT 2015


Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 src/gallium/winsys/virgl/drm/virgl_drm_winsys.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
index d9b4d58..0616de3 100644
--- a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
+++ b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
@@ -236,7 +236,6 @@ virgl_bo_transfer_put(struct virgl_winsys *vws,
 {
    struct virgl_drm_winsys *vdws = virgl_drm_winsys(vws);
    struct drm_virtgpu_3d_transfer_to_host tohostcmd;
-   int ret;
 
    memset(&tohostcmd, 0, sizeof(tohostcmd));
    tohostcmd.bo_handle = res->bo_handle;
@@ -245,8 +244,7 @@ virgl_bo_transfer_put(struct virgl_winsys *vws,
    tohostcmd.level = level;
   // tohostcmd.stride = stride;
   // tohostcmd.layer_stride = stride;
-   ret = drmIoctl(vdws->fd, DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST, &tohostcmd);
-   return ret;
+   return drmIoctl(vdws->fd, DRM_IOCTL_VIRTGPU_TRANSFER_TO_HOST, &tohostcmd);
 }
 
 static int
@@ -258,7 +256,6 @@ virgl_bo_transfer_get(struct virgl_winsys *vws,
 {
    struct virgl_drm_winsys *vdws = virgl_drm_winsys(vws);
    struct drm_virtgpu_3d_transfer_from_host fromhostcmd;
-   int ret;
 
    memset(&fromhostcmd, 0, sizeof(fromhostcmd));
    fromhostcmd.bo_handle = res->bo_handle;
@@ -267,8 +264,7 @@ virgl_bo_transfer_get(struct virgl_winsys *vws,
   // fromhostcmd.stride = stride;
   // fromhostcmd.layer_stride = layer_stride;
    fromhostcmd.box = *(struct drm_virtgpu_3d_box *)box;
-   ret = drmIoctl(vdws->fd, DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST, &fromhostcmd);
-   return ret;
+   return drmIoctl(vdws->fd, DRM_IOCTL_VIRTGPU_TRANSFER_FROM_HOST, &fromhostcmd);
 }
 
 static struct virgl_hw_res *virgl_drm_winsys_resource_cache_create(struct virgl_winsys *qws,
@@ -651,15 +647,13 @@ static int virgl_drm_get_caps(struct virgl_winsys *vws, struct virgl_drm_caps *c
 {
    struct virgl_drm_winsys *vdws = virgl_drm_winsys(vws);
    struct drm_virtgpu_get_caps args;
-   int ret;
 
    memset(&args, 0, sizeof(args));
 
    args.cap_set_id = 1;
    args.addr = (unsigned long)&caps->caps;
    args.size = sizeof(union virgl_caps);
-   ret = drmIoctl(vdws->fd, DRM_IOCTL_VIRTGPU_GET_CAPS, &args);
-   return ret;
+   return drmIoctl(vdws->fd, DRM_IOCTL_VIRTGPU_GET_CAPS, &args);
 }
 
 #define PTR_TO_UINT(x) ((unsigned)((intptr_t)(x)))
-- 
2.6.2



More information about the mesa-dev mailing list