aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Stultz2018-05-01 16:29:48 -0500
committerDmitry Shmidt2018-05-01 16:38:25 -0500
commita428014f953ba41a6b77b92379fe19c29c18802f (patch)
treef5ca90e98b5ce5b61c2079d38642c34f1999e067
parent898243f460089111e1942b56bf0b0cee367d893e (diff)
downloadexternal-libgbm-a428014f953ba41a6b77b92379fe19c29c18802f.tar.gz
external-libgbm-a428014f953ba41a6b77b92379fe19c29c18802f.tar.xz
external-libgbm-a428014f953ba41a6b77b92379fe19c29c18802f.zip
libdrm: amdgpu: Initialize unions with memset rather than "= {0}"
Clang complains when initializing unions using "= {0}" so instead use memset. Change-Id: Ib2fba6226ac4adfde7f0d271b3c953ac66cb84ee Signed-off-by: John Stultz <john.stultz@linaro.org>
-rw-r--r--amdgpu/amdgpu_cs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index 3c9be6c2..f9869087 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -705,12 +705,13 @@ int amdgpu_cs_submit_raw(amdgpu_device_handle dev,
705 struct drm_amdgpu_cs_chunk *chunks, 705 struct drm_amdgpu_cs_chunk *chunks,
706 uint64_t *seq_no) 706 uint64_t *seq_no)
707{ 707{
708 union drm_amdgpu_cs cs = {0}; 708 union drm_amdgpu_cs cs;
709 uint64_t *chunk_array; 709 uint64_t *chunk_array;
710 int i, r; 710 int i, r;
711 if (num_chunks == 0) 711 if (num_chunks == 0)
712 return -EINVAL; 712 return -EINVAL;
713 713
714 memset(&cs, 0, sizeof(cs));
714 chunk_array = alloca(sizeof(uint64_t) * num_chunks); 715 chunk_array = alloca(sizeof(uint64_t) * num_chunks);
715 for (i = 0; i < num_chunks; i++) 716 for (i = 0; i < num_chunks; i++)
716 chunk_array[i] = (uint64_t)(uintptr_t)&chunks[i]; 717 chunk_array[i] = (uint64_t)(uintptr_t)&chunks[i];
@@ -750,9 +751,10 @@ int amdgpu_cs_fence_to_handle(amdgpu_device_handle dev,
750 uint32_t what, 751 uint32_t what,
751 uint32_t *out_handle) 752 uint32_t *out_handle)
752{ 753{
753 union drm_amdgpu_fence_to_handle fth = {0}; 754 union drm_amdgpu_fence_to_handle fth;
754 int r; 755 int r;
755 756
757 memset(&fth, 0, sizeof(fth));
756 fth.in.fence.ctx_id = fence->context->id; 758 fth.in.fence.ctx_id = fence->context->id;
757 fth.in.fence.ip_type = fence->ip_type; 759 fth.in.fence.ip_type = fence->ip_type;
758 fth.in.fence.ip_instance = fence->ip_instance; 760 fth.in.fence.ip_instance = fence->ip_instance;