drm-shim: Fix unused variable warnings from asserts in release build.
authorEric Anholt <eric@anholt.net>
Mon, 24 Aug 2020 23:34:46 +0000 (16:34 -0700)
committerMarge Bot <eric+marge@anholt.net>
Fri, 28 Aug 2020 22:45:08 +0000 (22:45 +0000)
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6462>

src/drm-shim/device.c

index 97bb1183ea88fc474a21884f9df27402accaf401..0a7dfe7fb6dc33adb6c8295bb063c66f6aa68744 100644 (file)
@@ -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);