From patchwork Wed Apr 24 17:08:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 162801 Delivered-To: patches@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp903945jan; Wed, 24 Apr 2019 10:08:49 -0700 (PDT) X-Received: by 2002:aa7:85cc:: with SMTP id z12mr34627440pfn.142.1556125729785; Wed, 24 Apr 2019 10:08:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556125729; cv=none; d=google.com; s=arc-20160816; b=Dw9q1EoauEQ3GpQP0J+ac6LI6kclN+xZFJc7DGVm33yMpgb8SvqmKe8aGSSTB2ONWO 22QGawrU7j2Q67wjS4oOgY1TVUY72rkegS8U1hYddmIoPgJnGMA32Kz++xwMlRywA0KR r8jfr89Hl80T6TJlSOjBQxUsFgkCofO3VR85gyQ1mII+GYIAgPUTBCYGX2rGdRcPkAdY fUhROH+eB0IYA14mgtZ+npI7tdXEXp92XxEDWZ2Q0NjYCj33UCb4aoh5cGm4umXVLEfn u7qRxBgJ7GBBDP0KJkYfjiKL3trLyQa47fntmuIeezOLhmhnAvAG6jgGYop9MK+uMoMd MvqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=zKaUzrk/ydlVbPS7i5drt5PTA8n/bRh1ygekvEDrRTg=; b=fw3NszJctE0cSyQXSvHVkou71E94F10Y01DNlG/91NomLqm8MISidYc9HfXn9xsYR7 Rb0Wpzp9j7YX2LR4VYCaiOtsF9cg9RVhNc3dGi4+N7fur3UyyezqOAaUxXJr0k88+Ar9 LEZgIX3444nEnIAvFiYmlAviLcinip1rN5JOrJUYM3XYkmbjkXjfo1Nw4TUsWnh8CrsT Ha8aFo8yU/5Hv/Zditt8T6wgc4X1Y8Tx9+EBkCgUvAnH+i4O/Sa4WQX+iHdTPq50YRXU nQjFyW8NEjG0S8Ac8aRLUXV6AvCmue8SHgwgYVxKjbJQVTHbGJuh1Kmr42xMKxqvSTya rtCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wInlrsHg; 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 f34sor20665378pgb.14.2019.04.24.10.08.49 for (Google Transport Security); Wed, 24 Apr 2019 10:08:49 -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=wInlrsHg; 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 :mime-version:content-transfer-encoding; bh=zKaUzrk/ydlVbPS7i5drt5PTA8n/bRh1ygekvEDrRTg=; b=wInlrsHgv5UBYVx3X8ekJYXVzKjzvTYhIMVmeLaoMmHMUd7diw0iRKPZ0ojm08uSKR Ij+kj1j5W2o+DVuPaR6TuTLABO3oQi7/KJseYYL/O3c9l7DgefLyZsNj03Hj29QqNIma VM8p6S/sxVAet6dbWMJ991lvRsDvNdZl/+9tGT63jpKBSsTZ93NbWShIiFXAdw5EgFcJ ctvM8EXvCZ1Uix5tUfbZpA2/yAg2O474UAy+XzfMntGDnJkOFqLwBOa/J3P0NEYSqD41 3lr+UJuhBUVmCMa6aP9NWkNpsngLO5QMGfnGIp44i86FqfCT1Cj08khn17lB3gFwh4ae +O6A== 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:mime-version:content-transfer-encoding; bh=zKaUzrk/ydlVbPS7i5drt5PTA8n/bRh1ygekvEDrRTg=; b=clElWaT613MayQGlSYMjzcJ2qlvwDAOpMorhRezSYgtm7vMSgIJQzeUWP4IuYWlT0T 5GvgX7g/twcf8CgQOWTk+dwyp8kI5OENc8QdXblYg6w3kxDBxJ9ET8AOb6z0ytvqoGBK Xp98cAJj4nu3CwhbOfBmFSke+MiaX6TAxxTKXif8zr9i1xy84xgtfiWlpo2/1KEjMEpH etZcgf0E96ZibxZq7nePpuc77Mjoi0olN71S5mFCOgCJFm+xUGxu8q7PeDsxqffNmlH9 SDYp74ej3knhJ4U6CrDbLYhCjcnTv81J+60QD6FDemGzol+i97w5igpD6Thl4+Oifc0T BtGQ== X-Gm-Message-State: APjAAAVKiQgquaMKYT13Hvh033/zHuajCUkkmc4e5K4i2cwnp3Q7yE/C dPhQLx8Jifmsq1XsvE+C8rp5MSnc X-Google-Smtp-Source: APXvYqyxJZnNRgndbMjisqJ29bPkn6SEqbvQBvxDb5Pb7yXGbQjl6wBCVJJuXq8/aXpc0Wzvxvmmcw== X-Received: by 2002:a63:5c53:: with SMTP id n19mr31948290pgm.193.1556125729304; Wed, 24 Apr 2019 10:08:49 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id e4sm4425073pfn.185.2019.04.24.10.08.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Apr 2019 10:08:48 -0700 (PDT) From: John Stultz To: dri-devel Cc: John Stultz , Emil Velikov , Sean Paul , Alistair Strachan , Marissa Wall Subject: [PATCH 3/6 v2] libdrm: amdgpu: Initialize unions with memset rather than "= {0}" Date: Wed, 24 Apr 2019 10:08:38 -0700 Message-Id: <1556125721-32145-4-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556125721-32145-1-git-send-email-john.stultz@linaro.org> References: <1556125721-32145-1-git-send-email-john.stultz@linaro.org> MIME-Version: 1.0 Clang complains when initializing unions using "= {0}" so instead use memset. Cc: Emil Velikov Cc: Sean Paul Cc: Alistair Strachan Cc: Marissa Wall Reviewed-by: Alex Deucher Reviewed-by: Emil Velikov Reviewed-by: Christian König Signed-off-by: John Stultz --- amdgpu/amdgpu_cs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.7.4 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;