From patchwork Sat Oct 22 07:22:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7384 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1096691wrr; Sat, 22 Oct 2022 01:05:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6+XXbHjAMDcFH4cfEzLFxcDrPnZbwLcnzaJtVGaE6uFROMyiZmH1xuA83EmOBHafSMLfOe X-Received: by 2002:a17:90b:2812:b0:20d:7a3b:df3e with SMTP id qb18-20020a17090b281200b0020d7a3bdf3emr62815431pjb.169.1666425941882; Sat, 22 Oct 2022 01:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666425941; cv=none; d=google.com; s=arc-20160816; b=uZs1pRWgqTlyYfrVSqH37p/yXOurfpMXTIpCIwMjifY25DpOMQErGrZQ/3YK79jUFb FyoGuYSSrpgTvi/XX8jQ4OWDe0Div0zPcITTBN0HjwMPkuGVwJPuDw0D56AZ4mAZbodi RHs2yKdNpSdx33Xh4RNmqBxOSjvEPBxD4LyG9OupbUGIHzA+ksjuYCqKCkvq/nYXLVa7 WZZFAuIonlDLn72iqjyFR2jxF/15JfhXQ8Go/IeMC8j0bggk+f8fe9SNcW9LdXyf91dG xQXsO3yzkTpHVzg586cahRe6qRU0niht54aP0is6WLKC0UBaPF7tf3YNYIFc8zcn9tzG 51dw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AR2L7fgchsaszYJsW8H+Esbc2IYduhF/A6px8aeEEkc=; b=w0Ez0eV4ONfYLiyenqUcWNDtvO8ObanQscnBHEXsZ76gsP2uwKuP2w7TNMLlkXesCM Fw0upmYNcvqyT8lS5AkY/xxvaciSJJBHalOvCZ352vt28EyLrX2awrrEISs7+dWXfHji Kr9gEPhcF+DVetS3egiuz1Y6ZKIEUXQipyELSfAJniOEU/t20W1/k9HZVFKJA1hirBcK f+wDhu3d6wl2vJ8AUtJwLlLiULzfpNN5kH7UKZZNqm4QdsAzS5IoTc9/lzvXmoUDEQEE AhB04P4ZsdG9qJ9MoeHsHX4qgy7VukI01YvnJpAB5GJtI+qKqDDwXolPctUTJAYsWKzw 5FPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AmehfEeT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bk13-20020a056a02028d00b0045cfaf0bad4si26696135pgb.379.2022.10.22.01.05.27; Sat, 22 Oct 2022 01:05:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AmehfEeT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232964AbiJVIEc (ORCPT + 99 others); Sat, 22 Oct 2022 04:04:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232424AbiJVH66 (ORCPT ); Sat, 22 Oct 2022 03:58:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D282157881; Sat, 22 Oct 2022 00:49:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DF76BB82E22; Sat, 22 Oct 2022 07:48:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 359DDC433D6; Sat, 22 Oct 2022 07:48:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424922; bh=0AaFD66QoCu+aNMC5pc5YET2gdKwWwa6+Akg5ngrniw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AmehfEeTcFg0WS4OwxR2zojA6veqk4affVAwEufd6/vk6FFwrb3eZS0QksGw3F//g SgFJ5HdF7Vf0UKyEg1BN8S4d3BQJqJzf6eXkh4CsXo3K1/9VcEdjZN8BBZWdhB5a/C mCb91YBUL7bKd1YVcxUAx3RjLkZN3fHQpolPbizs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Maxime Ripard , Sasha Levin Subject: [PATCH 5.19 297/717] drm/bridge: Avoid uninitialized variable warning Date: Sat, 22 Oct 2022 09:22:56 +0200 Message-Id: <20221022072505.578097055@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747374248118323053?= X-GMAIL-MSGID: =?utf-8?q?1747374248118323053?= From: Dan Carpenter [ Upstream commit 7d1202738efda60155d98b370b3c70d336be0eea ] This code works, but technically it uses "num_in_bus_fmts" before it has been initialized so it leads to static checker warnings and probably KMEMsan warnings at run time. Initialize the variable to zero to silence the warning. Fixes: f32df58acc68 ("drm/bridge: Add the necessary bits to support bus format negotiation") Signed-off-by: Dan Carpenter Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/YrrIs3hoGcPVmXc5@kili Signed-off-by: Sasha Levin --- drivers/gpu/drm/drm_bridge.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c index c96847fc0ebc..36ca4092c1ab 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -823,8 +823,8 @@ static int select_bus_fmt_recursive(struct drm_bridge *first_bridge, struct drm_connector_state *conn_state, u32 out_bus_fmt) { + unsigned int i, num_in_bus_fmts = 0; struct drm_bridge_state *cur_state; - unsigned int num_in_bus_fmts, i; struct drm_bridge *prev_bridge; u32 *in_bus_fmts; int ret; @@ -945,7 +945,7 @@ drm_atomic_bridge_chain_select_bus_fmts(struct drm_bridge *bridge, struct drm_connector *conn = conn_state->connector; struct drm_encoder *encoder = bridge->encoder; struct drm_bridge_state *last_bridge_state; - unsigned int i, num_out_bus_fmts; + unsigned int i, num_out_bus_fmts = 0; struct drm_bridge *last_bridge; u32 *out_bus_fmts; int ret = 0;