From patchwork Mon Oct 24 11:29:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10311 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp656574wru; Mon, 24 Oct 2022 14:18:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4VwFNRYFaPBxB6p+6TLJcCUQ+htf0ngU1k1r5Ozn0z0A15TspxAdShNlZxz9APzingm9Bw X-Received: by 2002:a17:90a:5996:b0:203:1640:2dbf with SMTP id l22-20020a17090a599600b0020316402dbfmr41449885pji.150.1666646291119; Mon, 24 Oct 2022 14:18:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666646291; cv=none; d=google.com; s=arc-20160816; b=dBuVIpGwcn8dfVgqsQ5CT7CN3dtzcYFBwGlY6RRurHLhtO/TDhlR+lwBsA6JwkSBVY szVU1S54M0KMzzMqs/qX+BQvJ3nmwnAiBfsAYU3HJ9nUGVuCJmWPcKz23Pec1fU9bZ56 yz3yW0gX3NbDBbrMpBGpjpfGPYKsrGExg1Z4JtS6QNEpsw9FObYRO1Jdk9PtZEXGaYou yspn3qfZraA0hQY4Hkb1FcQ3Qh8/5dCby9Ks907i1XdjC44AkqUDg7+VxgCePKEPpV17 UwdND8JWA/j9s5hHV2/XRdo9mbU4JKBxo6mhy4wItES8/ClpnAiMX19gwiAx744d9REN fCnA== 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=PvjxYAPy4W7TZRpkQQsMn3uJfpBzM3paONBTQnrcqVY=; b=Q97AAsEw6JAEt84CbYSP2QQFoMxHG/05lc5TkmMqFqthoEqmVIq8DQcz8cpVwF/ecy Skhw/fHZ6avogxm6LZUSpvsQklRb3YHteUQW3v+G1lsTyDjdcf6E/E+Dz+IHd0SrZKXw 80DHsXbyItYzcRIVWkh8jT+nqcmLPLjMvni1Mum3opA1SnHY4jPD0Q4wGuDrQ2kWLEp5 jbr3CfM0drlLMO/k6JGefOkpyS8OyuzBGw+WIwV70OhMdcFeB+joG39ilCdFY+vLQ9ee QC3Dk+WYEC2ldHIoTIPQ31nfrE3WlfzahxVWeB65pT9di4du/9MQ47FtZkvzFquk65Ow Aucg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dQpTVKY7; 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 b18-20020a63eb52000000b00434b19dc958si693950pgk.349.2022.10.24.14.17.58; Mon, 24 Oct 2022 14:18:11 -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=dQpTVKY7; 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 S233589AbiJXVRY (ORCPT + 99 others); Mon, 24 Oct 2022 17:17:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230437AbiJXVQl (ORCPT ); Mon, 24 Oct 2022 17:16:41 -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 7B93B17F644; Mon, 24 Oct 2022 12:22:37 -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 01869B8198B; Mon, 24 Oct 2022 12:42:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A3BFC433C1; Mon, 24 Oct 2022 12:42:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615329; bh=1yz2m924UooZlxeRhPwZdGxdyp876Gmwvdmqv0MWqBE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dQpTVKY7KRF1bdgcH1/YWaAWXhtgDWbtaOeqMCKwKp6ixY4vAjZVxAhBQWLU1IGU1 v5tC83o3gkShFYFWRh8/pYJXB3ujfVz6PMSqatiE4R9m2vUVAM9sR4Lcn33WKsPi9V UBGL5UAScXN9D2nPWQevBvdLRYqIDIdnTUqsAfKw= 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.15 210/530] drm/bridge: Avoid uninitialized variable warning Date: Mon, 24 Oct 2022 13:29:14 +0200 Message-Id: <20221024113054.579146782@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@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?1747605301526737822?= X-GMAIL-MSGID: =?utf-8?q?1747605301526737822?= 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 7ee29f073857..78bc315b0b73 100644 --- a/drivers/gpu/drm/drm_bridge.c +++ b/drivers/gpu/drm/drm_bridge.c @@ -762,8 +762,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; @@ -884,7 +884,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;