anv: fix error message
authorEric Engestrom <eric.engestrom@intel.com>
Thu, 24 Oct 2019 12:04:51 +0000 (13:04 +0100)
committerEric Engestrom <eric@engestrom.ch>
Thu, 24 Oct 2019 13:57:40 +0000 (13:57 +0000)
`strerror()` takes an `errno`, not the negative value returned by the
`ioctl()`.
Instead of fixing this as `"%s", strerror(errno)`, let's just use the
`"%m"` shortcut for it.

Fixes: 2b5f30b1d91b98ab27ba ("anv: implement VK_INTEL_performance_query")
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/vulkan/anv_perf.c

index 6a9fb4f6f1168fa75ba87942b959b2547f624f2b..a6b9420342285c81100a4122a208bc3528c303b5 100644 (file)
@@ -202,11 +202,8 @@ VkResult anv_QueueSetPerformanceConfigurationINTEL(
    } else {
       int ret = gen_ioctl(device->perf_fd, I915_PERF_IOCTL_CONFIG,
                           (void *)(uintptr_t) _configuration);
-      if (ret < 0) {
-         return anv_device_set_lost(device,
-                                    "i915-perf config failed: %s",
-                                    strerror(ret));
-      }
+      if (ret < 0)
+         return anv_device_set_lost(device, "i915-perf config failed: %m");
    }
 
    return VK_SUCCESS;