From patchwork Sat Apr 20 04:24:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 162544 Delivered-To: patches@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp170066jan; Fri, 19 Apr 2019 21:25:03 -0700 (PDT) X-Received: by 2002:a62:be13:: with SMTP id l19mr7951678pff.137.1555734303774; Fri, 19 Apr 2019 21:25:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555734303; cv=none; d=google.com; s=arc-20160816; b=LumQ18HwsLPR9zsuJ4y4qxqwB7w+YWcXCN308gOgowHlrJYq16v805/m+XVbF9GSzY QBYRex33tS4FKUw0gVdQNnAIjh3c4wFQQYHQZLbF2GCMU6whx0XahbzgAMS7ZSFVGU7b dFTHZVvwbO8aYGWA/sZbylBqTo9zAybOUOqT1FN9Ib2Nxfik6oExPoqQha4WAgeSYZcc mAO0zkJVXtQyvYLQ44d/MrDgNcA/aeDRMyyx3xQK82tftnxF+bN7LX6xko2FI07OjSIa a+0vWP71bexbSkDiH8/Li8JSoUPDMEcY13ysmNzkrL2ZoOCwte5PaONE7AyH0yZbWDDI 110g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ICzolK1vGHJtMx6aiA0wVAu6ysqyrhnjQX3IXkGcMrE=; b=No1FFcDimvcqfpe8AFk4Itv8fayBBTPQNaBDgZ9JD6c36TRS2UAk+t3p8LP7FDqKQ6 G+DAn2SaaePttCzOTRXxLoCC7P2/deSmtF94MOqOp2QxsgKC7f4FecHn4SVBLZLUC36/ dzjBnnYNN+hhKhrNT4Bh3Z8uKAAqEX2D48jNZAjUbhEfmpvO/F4EW0ZiI4vM8UhFmjsW 4ykQd2/kWBkl1glh8bQ5DVa6AgjnkNUDGzBlfxEF1qWYAuVVXlzWJbyg1yl3MROyfkDQ ZFnSrHzHusKsrLhvGl7abk4IzcE/gIQczRoUn8JFWQF/zebED1UqMkZN/e3njC5zffd2 HvzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CKMhLwSL; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id c193sor3788777pga.4.2019.04.19.21.25.03 for (Google Transport Security); Fri, 19 Apr 2019 21:25:03 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CKMhLwSL; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ICzolK1vGHJtMx6aiA0wVAu6ysqyrhnjQX3IXkGcMrE=; b=CKMhLwSLxlJln343f+Yw4Cb5B9/clLRibP9DwzobpAnnjIn3bryQhG03fS7pyJYkb5 pLETLuuMIwLe5I6Ud8Jf0iuR9elhyIZCu+OeTLT3qYXASyQsIVQTjCxdx6SgHJ2TnC4D E8LElMIWXxi8baoivDSPVSybxER5ozNAHpbCZ0tqRLIqK98NbQb/dQSPxhZBXGt8IlID Io0Cc/k0zt/xMCb+9LSG+Fz9er9R6or/W+fTssix8COexN4vPuMZoHB855PXmiDLfXGX AFv6froD0ST2msChKxsVEzgO48pvwxz7cna5OBAuHLs4EdapSl8hJ7kJj4qW622WcIFC pPPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ICzolK1vGHJtMx6aiA0wVAu6ysqyrhnjQX3IXkGcMrE=; b=QXoWg7nIQ4z1YIXzsbNXADJPQsBn8BxoEHXZAHtetzmUFdhCIYNSkOv52sA4rZpl2P UUe0ywG6mFDPctW5qLpH4SDokHOy5h1RLTBUJZyp4s1pBacbrSAsD7pR93nJsi9yCs69 4wyP8Jn8UC8Eq0lfS05Bqb73/Ofc7yvcaArPSFOFpr+3yI0w1PgPArohhb88Yw9EfPzb KUHtJR34J+ff6FuLVWcKfZauS/L/Q2vLyDpyoeXUnm+KdOMLrhs8CWO0K7ifmmG5P4V8 WI9XMernDRU+U2WOh/tKXugGYch/zkq4cf1QG6LW0jSwF3MN0yYRXjrAXq7gz90dfYmZ rEug== X-Gm-Message-State: APjAAAW58dZyFbwQF7nm2n4IHE+E7falHXfHWSrL9jzu5TXFlQ1KmSzz ZzrRrTDuT4akM9QkOzeMcEP1Fsctftjd5g== X-Google-Smtp-Source: APXvYqzvzUK7tYAwxUlFHku8ef7NzrL8q1SF9mrFniWhDD9qw6573m0t7MTD92jX/0EzCWbRhCUA8g== X-Received: by 2002:a63:c749:: with SMTP id v9mr7457861pgg.432.1555734303382; Fri, 19 Apr 2019 21:25:03 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id i1sm15578372pgc.63.2019.04.19.21.25.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Apr 2019 21:25:02 -0700 (PDT) From: John Stultz To: dri-devel Cc: John Stultz , Emil Velikov , Sean Paul , Alistair Strachan , Marissa Wall Subject: [RFC][PATCH 2/5] libdrm: amdgpu: Initialize unions with memset rather than "= {0}" Date: Fri, 19 Apr 2019 21:24:52 -0700 Message-Id: <1555734295-31015-3-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555734295-31015-1-git-send-email-john.stultz@linaro.org> References: <1555734295-31015-1-git-send-email-john.stultz@linaro.org> Clang complains when initializing unions using "= {0}" so instead use memset. Cc: Emil Velikov Cc: Sean Paul Cc: Alistair Strachan Cc: Marissa Wall Signed-off-by: John Stultz --- amdgpu/amdgpu_cs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.7.4 Reviewed-by: Alex Deucher Reviewed-by: Emil Velikov Reviewed-by: Christian König diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c index 7ee844f..7c5b9d1 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;