Mesa (main): venus: silence compiler warnings
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jun 3 17:53:08 UTC 2021
Module: Mesa
Branch: main
Commit: 551d7032dfcf3a8e8bfe7889092b2befc1071db5
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=551d7032dfcf3a8e8bfe7889092b2befc1071db5
Author: Chia-I Wu <olvaffe at gmail.com>
Date: Thu Jun 3 09:10:36 2021 -0700
venus: silence compiler warnings
Silence warnings in release builds.
Signed-off-by: Chia-I Wu <olvaffe at gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11166>
---
src/virtio/vulkan/vn_command_buffer.c | 2 +-
src/virtio/vulkan/vn_device.c | 1 -
src/virtio/vulkan/vn_device_memory.c | 6 ++++--
src/virtio/vulkan/vn_queue.c | 6 +++---
src/virtio/vulkan/vn_renderer.h | 4 ++--
src/virtio/vulkan/vn_renderer_virtgpu.c | 5 +++--
6 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/src/virtio/vulkan/vn_command_buffer.c b/src/virtio/vulkan/vn_command_buffer.c
index 655a071d7fb..65e0e45a21c 100644
--- a/src/virtio/vulkan/vn_command_buffer.c
+++ b/src/virtio/vulkan/vn_command_buffer.c
@@ -368,7 +368,7 @@ vn_cmd_begin_render_pass(struct vn_command_buffer *cmd,
/* find fb attachments */
const VkImageView *views;
- uint32_t view_count;
+ ASSERTED uint32_t view_count;
if (fb->image_view_count) {
views = fb->image_views;
view_count = fb->image_view_count;
diff --git a/src/virtio/vulkan/vn_device.c b/src/virtio/vulkan/vn_device.c
index e1a9c053773..a9380aebc22 100644
--- a/src/virtio/vulkan/vn_device.c
+++ b/src/virtio/vulkan/vn_device.c
@@ -1468,7 +1468,6 @@ vn_physical_device_get_native_extensions(
exts->KHR_swapchain = true;
exts->KHR_swapchain_mutable_format = true;
#endif
-
}
static void
diff --git a/src/virtio/vulkan/vn_device_memory.c b/src/virtio/vulkan/vn_device_memory.c
index 330d0b5c5c8..bf19970bebf 100644
--- a/src/virtio/vulkan/vn_device_memory.c
+++ b/src/virtio/vulkan/vn_device_memory.c
@@ -371,7 +371,8 @@ vn_GetDeviceMemoryOpaqueCaptureAddress(
VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo *pInfo)
{
struct vn_device *dev = vn_device_from_handle(device);
- struct vn_device_memory *mem = vn_device_memory_from_handle(pInfo->memory);
+ ASSERTED struct vn_device_memory *mem =
+ vn_device_memory_from_handle(pInfo->memory);
assert(!mem->base_memory);
return vn_call_vkGetDeviceMemoryOpaqueCaptureAddress(dev->instance, device,
@@ -455,7 +456,8 @@ vn_GetDeviceMemoryCommitment(VkDevice device,
VkDeviceSize *pCommittedMemoryInBytes)
{
struct vn_device *dev = vn_device_from_handle(device);
- struct vn_device_memory *mem = vn_device_memory_from_handle(memory);
+ ASSERTED struct vn_device_memory *mem =
+ vn_device_memory_from_handle(memory);
assert(!mem->base_memory);
vn_call_vkGetDeviceMemoryCommitment(dev->instance, device, memory,
diff --git a/src/virtio/vulkan/vn_queue.c b/src/virtio/vulkan/vn_queue.c
index 610c95db698..b1cfa79ea6a 100644
--- a/src/virtio/vulkan/vn_queue.c
+++ b/src/virtio/vulkan/vn_queue.c
@@ -787,7 +787,7 @@ vn_GetSemaphoreCounterValue(VkDevice device,
{
struct vn_device *dev = vn_device_from_handle(device);
struct vn_semaphore *sem = vn_semaphore_from_handle(semaphore);
- struct vn_sync_payload *payload = sem->payload;
+ ASSERTED struct vn_sync_payload *payload = sem->payload;
assert(payload->type == VN_SYNC_TYPE_DEVICE_ONLY);
return vn_call_vkGetSemaphoreCounterValue(dev->instance, device, semaphore,
@@ -815,7 +815,7 @@ vn_find_first_signaled_semaphore(VkDevice device,
uint32_t count)
{
for (uint32_t i = 0; i < count; i++) {
- uint64_t val;
+ uint64_t val = 0;
VkResult result =
vn_GetSemaphoreCounterValue(device, semaphores[i], &val);
if (result != VK_SUCCESS || val >= values[i])
@@ -832,7 +832,7 @@ vn_remove_signaled_semaphores(VkDevice device,
{
uint32_t cur = 0;
for (uint32_t i = 0; i < *count; i++) {
- uint64_t val;
+ uint64_t val = 0;
VkResult result =
vn_GetSemaphoreCounterValue(device, semaphores[i], &val);
if (result != VK_SUCCESS)
diff --git a/src/virtio/vulkan/vn_renderer.h b/src/virtio/vulkan/vn_renderer.h
index 6f818a5753b..6f5ef659605 100644
--- a/src/virtio/vulkan/vn_renderer.h
+++ b/src/virtio/vulkan/vn_renderer.h
@@ -297,7 +297,7 @@ static inline struct vn_renderer_shmem *
vn_renderer_shmem_ref(struct vn_renderer *renderer,
struct vn_renderer_shmem *shmem)
{
- const int old =
+ ASSERTED const int old =
atomic_fetch_add_explicit(&shmem->refcount, 1, memory_order_relaxed);
assert(old >= 1);
@@ -365,7 +365,7 @@ vn_renderer_bo_create_from_dma_buf(struct vn_renderer *renderer,
static inline struct vn_renderer_bo *
vn_renderer_bo_ref(struct vn_renderer *renderer, struct vn_renderer_bo *bo)
{
- const int old =
+ ASSERTED const int old =
atomic_fetch_add_explicit(&bo->refcount, 1, memory_order_relaxed);
assert(old >= 1);
diff --git a/src/virtio/vulkan/vn_renderer_virtgpu.c b/src/virtio/vulkan/vn_renderer_virtgpu.c
index 3889b37d047..b17f2477067 100644
--- a/src/virtio/vulkan/vn_renderer_virtgpu.c
+++ b/src/virtio/vulkan/vn_renderer_virtgpu.c
@@ -667,7 +667,7 @@ virtgpu_ioctl_gem_close(struct virtgpu *gpu, uint32_t gem_handle)
.handle = gem_handle,
};
- const int ret = virtgpu_ioctl(gpu, DRM_IOCTL_GEM_CLOSE, &args);
+ ASSERTED const int ret = virtgpu_ioctl(gpu, DRM_IOCTL_GEM_CLOSE, &args);
assert(!ret);
}
@@ -741,7 +741,8 @@ virtgpu_ioctl_syncobj_destroy(struct virtgpu *gpu, uint32_t syncobj_handle)
.handle = syncobj_handle,
};
- const int ret = virtgpu_ioctl(gpu, DRM_IOCTL_SYNCOBJ_DESTROY, &args);
+ ASSERTED const int ret =
+ virtgpu_ioctl(gpu, DRM_IOCTL_SYNCOBJ_DESTROY, &args);
assert(!ret);
}
More information about the mesa-commit
mailing list