From patchwork Wed Oct 19 08:27:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4677 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp212861wrs; Wed, 19 Oct 2022 02:08:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4aMTRQ2GFhNUynqYghK1/IiI1DnbTQ//P8mVuXEtRYGCabzIu3Not8gBdE6dXORKHIOSf6 X-Received: by 2002:a17:906:8451:b0:78d:d467:55a4 with SMTP id e17-20020a170906845100b0078dd46755a4mr5817437ejy.352.1666170511065; Wed, 19 Oct 2022 02:08:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666170511; cv=none; d=google.com; s=arc-20160816; b=TSdxROys6/4KRmgzJEzWY9XVCqmqKQTk2rxv/OrXYZJkp0Ufbt6zx57C9+tLXr+c44 si18CP++BoYz9dv2HeTP0TkPMvyMwE8OV2CudKFXSk9X22Snzz7ggQSo/4ez6Oe5nHxC j/ezFW4lgAR8h0JksGa5Nj3sadsDXeGHUYKXPC/bR9VzRX+JrvfHpsRMFXUvurNubtCg sSp8yl9kWs5pbOhDHipzMNekPaHkhmkfE9E/wsAytJ9ndFGee2bFUi4sG2+5kNITK05t 8E4vs4j87V4sQ5w6cy2E5/xYo28Rp/equWnEYfm+CFMtd3a/le8ROu8bKEfCSXHIyEm/ pgjQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sd42-20020a1709076e2a00b0077ccad52420si14215606ejc.275.2022.10.19.02.08.01; Wed, 19 Oct 2022 02:08:31 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747106409719682971?= X-GMAIL-MSGID: =?utf-8?q?1747106409719682971?= 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;