Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp446430pxb; Thu, 30 Sep 2021 09:19:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHs5hEu2vr01ZWL31u0y/JaqtotOO/JVmsduuvnU2PUgmg4OB9ajBzNvyLKkHWreY4X/g4 X-Received: by 2002:aa7:9005:0:b0:44b:fa4e:95c2 with SMTP id m5-20020aa79005000000b0044bfa4e95c2mr3263859pfo.29.1633018783136; Thu, 30 Sep 2021 09:19:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633018783; cv=none; d=google.com; s=arc-20160816; b=NaNCZmz2YtrwsEiHQCDq+q3PJo/3XtIiDLfT3ZVSM0teT9yndnStAio94PoLcmmivN AT9XDzyhEGFsFcW1R2BqwnMCjzyo1QjGn2BTRFOgCDuh/qpeLOWDmTBgvQ4E5izFTabm NzT5nhkh22C9APizHbs0A/c3IvmIBmFPA0p/FaaZJzYS7BAjr3wd0qogWanIAgPsMGbP fVtx6j+usC9qViTM2NJxv9n6QkGHfClK1J1zLyOH5OaxBXMhaOK8fF5KAG6SP6rNxAGS 05SbH4ggVjEhK9rcHg9YiEd31Jbh8y9bKGYRwjna6i29FQ/TdIzXI8Kq5Xfmdi01MJQq +Lmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=gdJM7Qylry0S4G5BdCwPkmvBDwkYADzRUgmrrKXs0jM=; b=IUL3xHP2VV0Q1c8llrqjn2bvfMQglGeboLdztukW91naYzCyhZ+HDCpHDFFIHDvM2g URye0iEx5IS0FMF0K5yCti0RJkVrUJvwfIMQporSKBJWnH0y0DxD+UT2Wfuh9aNPUFax CYtjRDsYdX2PJq1N7zTBqAS1LRc71Dq6eaFp831/PL72boO5nqFYWgVm/KOXq4UCHtA9 XUp4Cez/AITCabBDpimsKfoxJaBodslQmcmVCMOTX2zEnBxUXJH69L2sXOYBV8LZPsSl n/jBXPe8PPLbTu8ugR3csisg656+pEbuNKrrrcMYxmkEmbevO63gVZLoLzpYfiH8zk9P kn0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SNYZDE4c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e24si4708947pgt.528.2021.09.30.09.19.30; Thu, 30 Sep 2021 09:19:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SNYZDE4c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349597AbhI3QSj (ORCPT + 99 others); Thu, 30 Sep 2021 12:18:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:46710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349614AbhI3QSf (ORCPT ); Thu, 30 Sep 2021 12:18:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D7CF261350; Thu, 30 Sep 2021 16:16:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1633018612; bh=nCm24fdzKI9A0hhedzu8MKlkLPZNsO0zfw6Ufjqtw1s=; h=From:To:Cc:Subject:Date:From; b=SNYZDE4cB9ZKnXPiLID0J9mW0WYRHEnkyUwDKacOGjwGmflwsAzAcbT51bZgykUPx VtCGKIPqZFfkd/8SgC455IYJwlEeIETYi11AcHBWptBBQqcyq0Kbz1fAcaV7uj0beo W3mx3RD3QKnIdlDhSbAm+7RwFWT4G0szsB1eDW0GGe+JjkTo1AAt5BC/42cJLRSNga ramwKJB8eU/cbcFoqkkUTUNU4FmIdmQmvJDkS81UpvVDV4g6RbJGZ2xczI3VjofBmO O9Qn2kidIO+6b72r4hLtBPgX9KaAMRrG+WyD203dBA+tP3+Vto8P7RG4M2l8EI4vuE nEQ9hoaflfUSQ== From: Nathan Chancellor To: Harry Wentland , Leo Li , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "Pan, Xinhui" Cc: Nick Desaulniers , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor Subject: [PATCH] drm/amd: Initialize remove_mpcc in dcn201_update_mpcc() Date: Thu, 30 Sep 2021 09:16:42 -0700 Message-Id: <20210930161641.2333583-1-nathan@kernel.org> X-Mailer: git-send-email 2.33.0.591.gddb1055343 MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clang warns: drivers/gpu/drm/amd/amdgpu/../display/dc/dcn201/dcn201_hwseq.c:505:6: error: variable 'remove_mpcc' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] if (mpc->funcs->get_mpcc_for_dpp_from_secondary) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/../display/dc/dcn201/dcn201_hwseq.c:509:6: note: uninitialized use occurs here if (remove_mpcc != NULL && mpc->funcs->remove_mpcc_from_secondary) ^~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/../display/dc/dcn201/dcn201_hwseq.c:505:2: note: remove the 'if' if its condition is always true if (mpc->funcs->get_mpcc_for_dpp_from_secondary) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/../display/dc/dcn201/dcn201_hwseq.c:442:26: note: initialize the variable 'remove_mpcc' to silence this warning struct mpcc *remove_mpcc; ^ = NULL 1 error generated. The code already handles remove_mpcc being NULL just fine so initialize it to NULL at the beginning of the function so it is never used uninitialized. Fixes: ff7e396f822f ("drm/amd/display: add cyan_skillfish display support") Link: https://github.com/ClangBuiltLinux/linux/issues/1469 Signed-off-by: Nathan Chancellor --- drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c index ceaaeeb8f2de..cfd09b3f705e 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c +++ b/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c @@ -439,7 +439,7 @@ void dcn201_update_mpcc(struct dc *dc, struct pipe_ctx *pipe_ctx) bool per_pixel_alpha = pipe_ctx->plane_state->per_pixel_alpha && pipe_ctx->bottom_pipe; int mpcc_id, dpp_id; struct mpcc *new_mpcc; - struct mpcc *remove_mpcc; + struct mpcc *remove_mpcc = NULL; struct mpc *mpc = dc->res_pool->mpc; struct mpc_tree *mpc_tree_params = &(pipe_ctx->stream_res.opp->mpc_tree_params); base-commit: 30fc33064c846df29888c3c61e30a064aad3a342 -- 2.33.0.591.gddb1055343