From patchwork Mon Oct 24 11:28:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9664 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp534608wru; Mon, 24 Oct 2022 09:11:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Zu1jIiXOYB7mnX5sf01Mi1yxYXx/uF5Lu+CeFW1Q79BGK7S/1PMXMgjlEwi4qKb+aegIu X-Received: by 2002:a05:6a02:18f:b0:44a:3972:898d with SMTP id bj15-20020a056a02018f00b0044a3972898dmr28427757pgb.525.1666627883663; Mon, 24 Oct 2022 09:11:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666627883; cv=none; d=google.com; s=arc-20160816; b=0B4TN3Z0VPFftyABYv744zWaXSqhG3Y6MlUWJDK511mGAkNmRTpDwfUofecTTYriBx KzRNWHN73OOwjEVbA0jdfJZWksyi4z6L8KliqRITK3RVPkoVFxiHkAQLIrEvULuERytO +QG5296t+kCVC7C6Rl+J44msOWRsBpCjlv/faVzxC9r/+3TiAjWAcNiSil8IyJpqdfAd OKci/Z2qvB+8IrL66K4qe6PBbuo5qdjj8wqSFy1FnW5dBrA/dMJXMOVbV90mjTwngIjo 9bAk+B1ct4I5Go5YRMRsZjNXxt9SfjqTWUU2OA652DJRgL6guuFraZGvaZrZauoBqIRc 01Vg== 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=7eEqY6k1uVv12BMnpyTNdmCMALjaybJV/AuP/23o6Y8=; b=J21pxuqh1A671XDd8ItO86VPM/S+S72HnWPRZCBF49sw7SqCzHyxfojOSch7P5aQDH u0rJqLyaKEhF9RtUv5mxIe/TDu+0UGF7d48eiASvrCE7XfXtamlXMY9Z2XEaWpIRUG8V yAYLEuXpP9lJJng+HHML6kTxkQbQETt95Hu+yrdNC9eoPAnsfMdk/RHjEzy3IZqnvH6W BqG7jWaYUTQA1k3ODvgXKlwc5n+lG/NABamtfI2y0Kzaju+HJDy7mVHdWZrx4pMEPyNf 13Ytbfo1PCQvnX1eBJpfW6pCXxaUSeQu5EHw/MvFetwUv0d8j8dDR+uiSX/YdWp0jSzb 6rbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XfHj0BdO; 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 cp8-20020a056a00348800b0056aff71af29si30197pfb.209.2022.10.24.09.11.10; Mon, 24 Oct 2022 09:11:23 -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=XfHj0BdO; 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 S234032AbiJXQJX (ORCPT + 99 others); Mon, 24 Oct 2022 12:09:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233732AbiJXQE7 (ORCPT ); Mon, 24 Oct 2022 12:04:59 -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 2812B11D99A; Mon, 24 Oct 2022 07:57:47 -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 479B9B81619; Mon, 24 Oct 2022 12:22:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9CB53C433C1; Mon, 24 Oct 2022 12:22:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614127; bh=Aq5KipdhSVuTofrbZe5rRzgyLMr2ZNid2GkaJRMPKIk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XfHj0BdOThBnjp9wVqThYXnVFgRSUq5B+kVXSahQubQp9opGR3H0x7P6CoXScjrUS SJd8UnOXqGuoPoaif+3Ednx3jQH66py+YRPI3fJxEYLq0xcOu84qeZ37BG1F5nGYJQ /Ing1vlQQEhA20pMNcDgy0QXkVxjVKXfR9sUZBBM= 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.10 142/390] drm/bridge: Avoid uninitialized variable warning Date: Mon, 24 Oct 2022 13:28:59 +0200 Message-Id: <20221024113028.721980804@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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?1747586000026258009?= X-GMAIL-MSGID: =?utf-8?q?1747586000026258009?= 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 044acd07c153..d799ec14fd7f 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -753,8 +753,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; @@ -875,7 +875,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;