summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2019-04-24 10:08:38 -0700
committerEmil Velikov <emil.l.velikov@gmail.com>2019-04-25 10:57:26 +0100
commit51553dd0e063cb2d27ad1c68746c247cb6dbd518 (patch)
treebca8f4afe61cac54091e2d2c6eaf2cb0f4a16bfe
parentebbb8f9cbfc3b51d52e6fe3b146ea824030eb48a (diff)
downloadlibdrm-51553dd0e063cb2d27ad1c68746c247cb6dbd518.tar.gz
libdrm-51553dd0e063cb2d27ad1c68746c247cb6dbd518.tar.bz2
libdrm-51553dd0e063cb2d27ad1c68746c247cb6dbd518.zip
libdrm: amdgpu: Initialize unions with memset rather than "= {0}"
Clang complains when initializing unions using "= {0}" so instead use memset. Cc: Sean Paul <seanpaul@chromium.org> Cc: Alistair Strachan <astrachan@google.com> Cc: Marissa Wall <marissaw@google.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: John Stultz <john.stultz@linaro.org>
-rw-r--r--amdgpu/amdgpu_cs.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index 7ee844fb..7c5b9d13 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -733,12 +733,13 @@ drm_public int amdgpu_cs_submit_raw(amdgpu_device_handle dev,
struct drm_amdgpu_cs_chunk *chunks,
uint64_t *seq_no)
{
- union drm_amdgpu_cs cs = {0};
+ union drm_amdgpu_cs cs;
uint64_t *chunk_array;
int i, r;
if (num_chunks == 0)
return -EINVAL;
+ memset(&cs, 0, sizeof(cs));
chunk_array = alloca(sizeof(uint64_t) * num_chunks);
for (i = 0; i < num_chunks; i++)
chunk_array[i] = (uint64_t)(uintptr_t)&chunks[i];
@@ -763,10 +764,11 @@ drm_public int amdgpu_cs_submit_raw2(amdgpu_device_handle dev,
struct drm_amdgpu_cs_chunk *chunks,
uint64_t *seq_no)
{
- union drm_amdgpu_cs cs = {0};
+ union drm_amdgpu_cs cs;
uint64_t *chunk_array;
int i, r;
+ memset(&cs, 0, sizeof(cs));
chunk_array = alloca(sizeof(uint64_t) * num_chunks);
for (i = 0; i < num_chunks; i++)
chunk_array[i] = (uint64_t)(uintptr_t)&chunks[i];
@@ -803,9 +805,10 @@ drm_public int amdgpu_cs_fence_to_handle(amdgpu_device_handle dev,
uint32_t what,
uint32_t *out_handle)
{
- union drm_amdgpu_fence_to_handle fth = {0};
+ union drm_amdgpu_fence_to_handle fth;
int r;
+ memset(&fth, 0, sizeof(fth));
fth.in.fence.ctx_id = fence->context->id;
fth.in.fence.ip_type = fence->ip_type;
fth.in.fence.ip_instance = fence->ip_instance;