diff options
author | Dave Airlie <airlied@gmail.com> | 2015-10-31 16:19:43 +1000 |
---|---|---|
committer | Dave Airlie <airlied@gmail.com> | 2015-11-08 06:27:02 +1000 |
commit | 87711183ac35d85ca7d2c2ee67536fe689d6bef3 (patch) | |
tree | 7c8fb7c681612934638a75db40e8565250709e24 /src | |
parent | 6c731d85666abb61c49e5b4affa196545f5ac086 (diff) | |
download | external_mesa3d-87711183ac35d85ca7d2c2ee67536fe689d6bef3.zip external_mesa3d-87711183ac35d85ca7d2c2ee67536fe689d6bef3.tar.gz external_mesa3d-87711183ac35d85ca7d2c2ee67536fe689d6bef3.tar.bz2 |
virgl: wrap ret assignment with braces to do correct thing
Coverity reported that ret could only be 0 or 1, since it
was setting ret = fn() > 0, instead of doing (ret = fn()) > 0.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/winsys/virgl/drm/virgl_drm_winsys.c | 2 | ||||
-rw-r--r-- | src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c index d77ebd6..b5d4435 100644 --- a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c +++ b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c @@ -309,7 +309,7 @@ virgl_drm_winsys_resource_cache_create(struct virgl_winsys *qws, while (curr != &qdws->delayed) { curr_res = LIST_ENTRY(struct virgl_hw_res, curr, head); - if (!res && (ret = virgl_is_res_compat(qdws, curr_res, size, bind, format) > 0)) + if (!res && ((ret = virgl_is_res_compat(qdws, curr_res, size, bind, format)) > 0)) res = curr_res; else if (os_time_timeout(curr_res->start, curr_res->end, now)) { LIST_DEL(&curr_res->head); diff --git a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c index b19c456..9c9ec04 100644 --- a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c +++ b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c @@ -343,7 +343,7 @@ virgl_vtest_winsys_resource_cache_create(struct virgl_winsys *vws, while (curr != &vtws->delayed) { curr_res = LIST_ENTRY(struct virgl_hw_res, curr, head); - if (!res && (ret = virgl_is_res_compat(vtws, curr_res, size, bind, format) > 0)) + if (!res && ((ret = virgl_is_res_compat(vtws, curr_res, size, bind, format)) > 0)) res = curr_res; else if (os_time_timeout(curr_res->start, curr_res->end, now)) { LIST_DEL(&curr_res->head); |