Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp587554pxb; Sat, 18 Sep 2021 11:21:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwM3KzQWiqpntEP44zYNBQUOMeBtjtS1hMrG6sRIiCiHbAgH+9gmADiuDJv5NCi7hrjTtcP X-Received: by 2002:a05:6638:3813:: with SMTP id i19mr13787186jav.16.1631989271569; Sat, 18 Sep 2021 11:21:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631989271; cv=none; d=google.com; s=arc-20160816; b=xyPG3UdE5o35Qs/3q6e13tBJl5uJKB2vRT+mlOC5YyrORDdXILAAfKevka3kLeox+z AeepLXaLyLPiqqW6Lsdzbv+i/3yYx9prdUEtiWqVTtLGCbBsH1oDRuJkznjvKRvNHihq 0lab2KP02n9PSvb83HY4jqHpdseuWB+ViymHiGTgboD5VvIYO021Le8kmwsGNiAWoffm I+I1dkRTV4gh8ZPAy3hylzSP/n2tW32g9FqFJyp8nxdNpKwTiFVeCcSDdrXJIhZrbe1C jLmhu/tpgITvz7sqMjEgpBuZxhR/HKryzBN6bjoVU+WeO7v0zqhcU+dBK8xCLptlcchU nF5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=3ITGjmk0l4X3duLh5Udhzxkua5Z2evysHTQBpyzCdB0=; b=zu6GOVTP1H9QZj5JZ2bBlikpsNK2NOVDsH3mNoNglcwZWYmv+6YLliJjG/tNFPm+uZ q81mMxbz6qfHaUjxcWtWsZ/8lyyUbvVTfkX6JImuuh4NwFWkPk5uEknzDAg/1DafbwSH +DAHoA0+0FPLlsA/Bba+GYzOpj1ubrvLoGPpBVcDEamAUvMp8mAqOkxY65Bmy/iGDOP2 GJ5RPSNxzhSKdq+BsFMWAbveF/5CT+tzbGbMVGxXm3JSe3EBBtORJrauhSsz22H8Rwut RzHbVGadvf620YSa6nYLa01W7H2d+ocqsLVDAjo0AtVcgiMhQXRUF+8fp/ee/MREFgiv A4mA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h26si9168308ioz.60.2021.09.18.11.20.55; Sat, 18 Sep 2021 11:21:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238686AbhIRJnh (ORCPT + 99 others); Sat, 18 Sep 2021 05:43:37 -0400 Received: from smtpbgsg2.qq.com ([54.254.200.128]:60931 "EHLO smtpbgsg2.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238420AbhIRJnc (ORCPT ); Sat, 18 Sep 2021 05:43:32 -0400 X-Greylist: delayed 959 seconds by postgrey-1.27 at vger.kernel.org; Sat, 18 Sep 2021 05:43:31 EDT X-QQ-mid: bizesmtp39t1631958120t47jr2rw Received: from localhost.localdomain (unknown [124.126.19.250]) by esmtp6.qq.com (ESMTP) with id ; Sat, 18 Sep 2021 17:41:59 +0800 (CST) X-QQ-SSF: 0140000000200070B000B00B0000000 X-QQ-FEAT: /rrU+puPB7Tk5bnqdyL8tUxn9Y8rEAEEEI4wjYzKXbUhAmg5fth3vv7XnXEfL wlFd7G4YZzmF7uGuI+yAhU/XKJ4GOAQFiTyYwASs3tQngyH62gP83ym/Mfy6yPISSJPhRjy 9oTTArd5BAzubAY+xjfYFTDanuBSF2FmJK+32vDAmt9u25XG0Aq+mtUPTThiu1IpRxkQ4Qh d97mmSNb7ZhH4XcGFYbQRI3DwWcIs2jM/r16ylriQ/3nB7vPbnLhUhjDFwf1bVCZjmbDEPQ 3X4vgnmTCT5+vwU2Ec7tVjfkcrrpKBalaB5Hlj3fOYVcfc4FTzFHtqzvkmA9AcebZiZSUC3 nf2JmkHq9DTcMEEJXd5DMh8kYprmYDeHo64bevX X-QQ-GoodBg: 2 From: Zhiwei Yang To: David Airlie , Daniel Vetter , Alex Deucher Cc: =?UTF-8?q?Christian=20K=C3=B6nig?= , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Zhiwei Yang Subject: [PATCH] drm/radeon: fix uninitialized bool variable Date: Sat, 18 Sep 2021 17:41:57 +0800 Message-Id: <20210918094157.4770-1-yangzhiwei@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybgforeign:qybgforeign1 X-QQ-Bgrelay: 1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The bool variable detected_hpd_without_ddc in struct radeon_connector is uninitialized when first used, that may cause unnecessary ddc ops. Make it as false when a new connector is alloced. Signed-off-by: Zhiwei Yang --- drivers/gpu/drm/radeon/radeon_connectors.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index fe12d9d91d7a..c1987a66373f 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c @@ -1866,6 +1866,7 @@ radeon_add_atom_connector(struct drm_device *dev, bool shared_ddc = false; bool is_dp_bridge = false; bool has_aux = false; + bool detected_hpd_without_ddc = false; if (connector_type == DRM_MODE_CONNECTOR_Unknown) return; @@ -1923,6 +1924,7 @@ radeon_add_atom_connector(struct drm_device *dev, radeon_connector->shared_ddc = shared_ddc; radeon_connector->connector_object_id = connector_object_id; radeon_connector->hpd = *hpd; + radeon_connector->detected_hpd_without_ddc = detected_hpd_without_ddc; radeon_connector->router = *router; if (router->ddc_valid || router->cd_valid) { @@ -2384,6 +2386,7 @@ radeon_add_legacy_connector(struct drm_device *dev, struct radeon_connector *radeon_connector; struct i2c_adapter *ddc = NULL; uint32_t subpixel_order = SubPixelNone; + bool detected_hpd_without_ddc = false; if (connector_type == DRM_MODE_CONNECTOR_Unknown) return; @@ -2414,6 +2417,7 @@ radeon_add_legacy_connector(struct drm_device *dev, radeon_connector->devices = supported_device; radeon_connector->connector_object_id = connector_object_id; radeon_connector->hpd = *hpd; + radeon_connector->detected_hpd_without_ddc = detected_hpd_without_ddc; switch (connector_type) { case DRM_MODE_CONNECTOR_VGA: -- 2.20.1