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: 10915295 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4343C922 for ; Wed, 24 Apr 2019 17:08:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CEE928B54 for ; Wed, 24 Apr 2019 17:08:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2146628B82; Wed, 24 Apr 2019 17:08:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C71F828B54 for ; Wed, 24 Apr 2019 17:08:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CF5D789256; Wed, 24 Apr 2019 17:08:53 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by gabe.freedesktop.org (Postfix) with ESMTPS id 49BE4891FF for ; Wed, 24 Apr 2019 17:08:50 +0000 (UTC) Received: by mail-pg1-x542.google.com with SMTP id f6so9673975pgs.8 for ; Wed, 24 Apr 2019 10:08:50 -0700 (PDT) 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=AYc1qbi6XT/WSTeMjt/hqEs/ep1X3jMRjxryQFU7ox7nkr5YvT9jrNCoJrCkjYmOyj 162YML93NKPKa+C8w6o5q09t59PKMAvtLcU42riXEW49Oe9DJEC87fhqXQM2hWT0B41k 7hOsXZ2RTQPsv9wHzyBBQvgG9+s6jPpziy8srAotybvJpo63e+muLjXpqDc2qIUgwsex E3YmOblYf4KrGguQ/1pAfYwlY58evZKw6Qh4UsbikUeX69HyHvCguCrq8D/JHQ0e77yF kQJkgsVaYh2O5i5yAOm/xFzuzRuEqjpsqbgLKbuMKVA9S26c/nmhHBle8H99O744xHTl 6DJg== X-Gm-Message-State: APjAAAVO1x6y0492QTpSjG+YjInkdAYBoRPtnCB8w/pOvbJRXIMVzZb3 ktWAuyxEcoHlkaJNuIRthHMd4xjjNFM= 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) 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 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 X-Mailman-Original-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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sean Paul , Marissa Wall , Alistair Strachan , Emil Velikov Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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;