All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix -WMissing-braces compile warning on android
@ 2018-05-18  4:43 Jenny Cao
  0 siblings, 0 replies; only message in thread
From: Jenny Cao @ 2018-05-18  4:43 UTC (permalink / raw)
  To: dri-devel; +Cc: Jenny Cao

use "{}" instead of "{0}" in empty struct defination to avoid missing-braces warning:
suggest braces around initialization of subobject [-Wmissing-braces]

Test: compilation on android with this warning free

Signed-off-by: Jenny Cao <jenny.q.cao@intel.com>
---
 amdgpu/amdgpu_cs.c | 4 ++--
 libsync.h          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index 3c9be6c2e835..40e12a61d611 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -705,7 +705,7 @@ 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)
@@ -750,7 +750,7 @@ 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;
 
 	fth.in.fence.ctx_id = fence->context->id;
diff --git a/libsync.h b/libsync.h
index f1a2f96d36bc..b4d3251c704d 100644
--- a/libsync.h
+++ b/libsync.h
@@ -85,7 +85,7 @@ static inline int sync_wait(int fd, int timeout)
 
 static inline int sync_merge(const char *name, int fd1, int fd2)
 {
-	struct sync_merge_data data = {0};
+	struct sync_merge_data data = {};
 	int ret;
 
 	data.fd2 = fd2;
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-05-18  4:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-18  4:43 [PATCH] Fix -WMissing-braces compile warning on android Jenny Cao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.