Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp798862rwi; Wed, 19 Oct 2022 03:09:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6c/aqvwiw+j/n3nku1uOPVLrQWFSIFQWfgXLItvq14ejGNPO0fjPH4rU4A3usKAd3zCjsL X-Received: by 2002:a17:906:5dae:b0:78e:302f:4218 with SMTP id n14-20020a1709065dae00b0078e302f4218mr6377292ejv.22.1666174169497; Wed, 19 Oct 2022 03:09:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666174169; cv=none; d=google.com; s=arc-20160816; b=QZym1Sxp4BDcjdYUiThqWFmA3boRTjMuIEFc2q5/n8fhG+11ZQ0m1R2Y4NJ0hObPvG YyFPL9Xve6/0y5tXk1B+nuEgSniOX+eGTstgjYap/9oQFE9/lccnpmnmKau9L3ph2fXS UNhhp2x/bA4Y/4eDBitCBNDQ0aDqqMeDngn7qlld+J7WpAfaACJnE/NIpDS5BtGs1GK0 h0EEYfC7UJDZQ87IsqzICr7/FejN4F2EJDDhGq6Q7/hc35mSArC9C6tjI4xB/VvozAtl cpPq1LbSx6BAzTI98l/9mJfbXTsKBcrVCF+Bukb45Pjx7XCqI3dckj3trFxjm8LcNCGa bcbg== 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=UYDvG08FMZhJkUR+WtYW1e2YAaoX4bNMuuddIuLRM3c=; b=wLIYEaod8ee6tE6KnCyog2uG4pfKZ+S3PivC/K0d2XmtezmayjmJoPgsSXxurWdStk 2xfv/gHP39yAYaiXFlLJ9KzV2R3duL139JP7+BEXU3FBYnh5hTN+ocy3JNg4Q63USL6v MToDQbM3U2+uoHsMvBKzHzGt6oinCQ8YyvevNXY8LAoR/gLg++N1EoCVDiwPYFDnJHuK F8ZttS85F5OcHJxE2KrZJ/LJzNsJeArhewZe56E2g1yx1jRyWEUHCaU/5pKpprFyWlZi sRuXA+Q7Q4NF7/G8DebE772yempyw0rm3qmAqZqmWYFEQECIqmoBh7ndcav2vFEDzzwU 8NMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="RKfn/eXH"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ce12-20020a170906b24c00b0073d9c29892csi11524565ejb.939.2022.10.19.03.09.01; Wed, 19 Oct 2022 03:09:29 -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="RKfn/eXH"; 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 S232269AbiJSJCp (ORCPT + 99 others); Wed, 19 Oct 2022 05:02:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232444AbiJSI7w (ORCPT ); Wed, 19 Oct 2022 04:59:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 168D76AEA9; Wed, 19 Oct 2022 01:55:29 -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 dfw.source.kernel.org (Postfix) with ESMTPS id D03FD617F0; Wed, 19 Oct 2022 08:53:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1B72C433D6; Wed, 19 Oct 2022 08:53:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169627; bh=OowrNALwkvS4Tcm3QNdrx2jP/lE+fwctiM0D4EOC+ts=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RKfn/eXHp9Maka1nkEiw+NQunJlYkT3q9Cw8E8Cg9T69oZLMKCTEIw1PPDlWryZvA aYohxiHZwpYpwnQSVkq4+uifVayzBPrAF2prDYRJUt7HVoUIHJBrC6T337jqxPvwUg RGfwDxcmmOJXpBo024DYK/BImJgBDrirdG6SwivU= 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 6.0 348/862] drm/bridge: Avoid uninitialized variable warning Date: Wed, 19 Oct 2022 10:27:15 +0200 Message-Id: <20221019083305.417150627@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 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 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 6abf7a2407e9..1545c50fd1c8 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -847,8 +847,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; @@ -969,7 +969,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; -- 2.35.1