aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Stultz2018-05-02 12:34:22 -0500
committerandroid-build-merger2018-05-02 12:34:22 -0500
commitf42b4ce5c5b06e3d9ee137b090b4e635873ef63e (patch)
treef5ca90e98b5ce5b61c2079d38642c34f1999e067
parent1fa3e778ae0e87c3a52748b1e782e627e49e00bb (diff)
parenta719d8b000213fbc8fc0b870cc144b9fa4834968 (diff)
downloadexternal-libgbm-f42b4ce5c5b06e3d9ee137b090b4e635873ef63e.tar.gz
external-libgbm-f42b4ce5c5b06e3d9ee137b090b4e635873ef63e.tar.xz
external-libgbm-f42b4ce5c5b06e3d9ee137b090b4e635873ef63e.zip
libdrm: amdgpu: Initialize unions with memset rather than "= {0}" am: a428014f95
am: a719d8b000 Change-Id: I5b0c0b5740161459e0832dd2559fb4a4d734e0a0
-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;