From patchwork Fri Feb 1 20:14:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 10794687 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 666F313A4 for ; Sun, 3 Feb 2019 15:23:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 578852B77E for ; Sun, 3 Feb 2019 15:23:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C39E2B784; Sun, 3 Feb 2019 15:23:26 +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,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,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 0AAD02B77E for ; Sun, 3 Feb 2019 15:23:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 414526E400; Sun, 3 Feb 2019 15:23:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3DC736E363; Fri, 1 Feb 2019 20:14:45 +0000 (UTC) Received: by mail-ed1-x544.google.com with SMTP id a20so6444243edc.8; Fri, 01 Feb 2019 12:14:45 -0800 (PST) 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:mime-version :content-transfer-encoding; bh=l6Nfu88pA53HNFg0+s4Z6awlFIAM9fPPZy5OIjL6MbQ=; b=aZKrC5E7k+LLzRkSBQuQOCOxxVMmvDVXNxKNeNSr/cYfaaVufFgD7H+sT5f7T8kWLK d8Ar5n0eA4+xUwJjn9iWtA7MgUrNfErnWqZfEhnEDsvw5tfW4hiqrhr/g7DzC4MGA64M nC9Yiq5DKDxGW9H24UtZHovc1a4UWlSZz2zTkSkQnG5/arVq7wJRq9Jx0r3taaXLGoIP ajRq2RKkNwiCmesYpNTYKvPAguHyOp219GDInZmyAynSR/AeRKNrM/kUB8s0mcBubrcG GLwpWcySvOhyFjaFEYiQ3sDpLfw2OAKYV5fZtaw8iUbnBldNhIB4EGsxHlv5J3miYPvm hOuQ== X-Gm-Message-State: AJcUukfkkxAbjIrRvcWuiOC5Z04fjz/K8DTtX66qELAxLfC+PWhpaXUh zr+yU53+zjnTSOaASp/Jo+0= X-Google-Smtp-Source: ALg8bN4OoNHEVuhRcBociptFvwNX2HG8xjQaHEDdAmLeyiF6JJ5DbL/wUTs3HGh9icKAz902oBe6hQ== X-Received: by 2002:a50:8c04:: with SMTP id p4mr40025412edp.274.1549052083599; Fri, 01 Feb 2019 12:14:43 -0800 (PST) Received: from localhost.localdomain ([2a01:4f9:2a:1fae::2]) by smtp.gmail.com with ESMTPSA id b15sm1406799ejl.42.2019.02.01.12.14.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Feb 2019 12:14:42 -0800 (PST) From: Nathan Chancellor To: Harry Wentland , Leo Li Subject: [PATCH] drm/amd/display: Use memset to initialize variables in amdgpu_dm_atomic_commit_tail Date: Fri, 1 Feb 2019 13:14:28 -0700 Message-Id: <20190201201428.13357-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Patchwork-Bot: notify X-Mailman-Approved-At: Sun, 03 Feb 2019 15:23:06 +0000 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: David Francis , Nick Desaulniers , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Nicholas Kazlauskas , amd-gfx@lists.freedesktop.org, Alex Deucher , Nathan Chancellor , =?utf-8?q?Christian_K=C3=B6ni?= =?utf-8?q?g?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Clang warns: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:5089:60: warning: suggest braces around initialization of subobject [-Wmissing-braces] struct dc_surface_update dummy_updates[MAX_SURFACES] = { 0 }; ^ {} Previous efforts to fix this type of warning by adding or removing braces have been met with some pushback in favor of using memset [1][2]. Do that here, mirroring commit 05794eff1aa6 ("drm/amdgpu/gmc: fix compiler errors [-Werror,-Wmissing-braces] (V2)") in this tree. [1]: https://lore.kernel.org/lkml/022e41c0-8465-dc7a-a45c-64187ecd9684@amd.com/ [2]: https://lore.kernel.org/lkml/20181128.215241.702406654469517539.davem@davemloft.net/ Fixes: 02d6a6fcdf68 ("drm/amd/display: Simplify underscan and ABM commit") Signed-off-by: Nathan Chancellor --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 1c1c162c4eee..f70f4bbde665 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5089,10 +5089,13 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) struct dm_connector_state *dm_new_con_state = to_dm_connector_state(new_con_state); struct dm_connector_state *dm_old_con_state = to_dm_connector_state(old_con_state); struct amdgpu_crtc *acrtc = to_amdgpu_crtc(dm_new_con_state->base.crtc); - struct dc_surface_update dummy_updates[MAX_SURFACES] = { 0 }; - struct dc_stream_update stream_update = { 0 }; + struct dc_surface_update dummy_updates[MAX_SURFACES]; + struct dc_stream_update stream_update; struct dc_stream_status *status = NULL; + memset(&dummy_updates, 0, sizeof(dummy_updates)); + memset(&stream_update, 0, sizeof(stream_update)); + if (acrtc) { new_crtc_state = drm_atomic_get_new_crtc_state(state, &acrtc->base); old_crtc_state = drm_atomic_get_old_crtc_state(state, &acrtc->base);