Mesa (master): drm-shim: Fix unused variable warnings from asserts in release build.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Aug 28 23:02:36 UTC 2020


Module: Mesa
Branch: master
Commit: ccb5e0b02b258e728cd4afb64ba7a75cefad2f09
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ccb5e0b02b258e728cd4afb64ba7a75cefad2f09

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Aug 24 16:34:46 2020 -0700

drm-shim: Fix unused variable warnings from asserts in release build.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6462>

---

 src/drm-shim/device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/drm-shim/device.c b/src/drm-shim/device.c
index 97bb1183ea8..0a7dfe7fb6d 100644
--- a/src/drm-shim/device.c
+++ b/src/drm-shim/device.c
@@ -85,7 +85,7 @@ drm_shim_device_init(void)
    shim_device.mem_fd = memfd_create("shim mem", MFD_CLOEXEC);
    assert(shim_device.mem_fd != -1);
 
-   int ret = ftruncate(shim_device.mem_fd, SHIM_MEM_SIZE);
+   ASSERTED int ret = ftruncate(shim_device.mem_fd, SHIM_MEM_SIZE);
    assert(ret == 0);
 
    util_vma_heap_init(&shim_device.mem_heap, 4096, SHIM_MEM_SIZE - 4096);
@@ -233,7 +233,7 @@ ioctl_fn_t core_ioctls[] = {
 int
 drm_shim_ioctl(int fd, unsigned long request, void *arg)
 {
-   int type = _IOC_TYPE(request);
+   ASSERTED int type = _IOC_TYPE(request);
    int nr = _IOC_NR(request);
 
    assert(type == DRM_IOCTL_BASE);



More information about the mesa-commit mailing list