From: Zhiwei Yang <yangzhiwei@uniontech.com>
To: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
"Zhiwei Yang" <yangzhiwei@uniontech.com>
Subject: [PATCH] drm/radeon: fix uninitialized bool variable
Date: Sat, 18 Sep 2021 17:41:57 +0800 [thread overview]
Message-ID: <20210918094157.4770-1-yangzhiwei@uniontech.com> (raw)
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 <yangzhiwei@uniontech.com>
---
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
next reply other threads:[~2021-09-18 9:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-18 9:41 Zhiwei Yang [this message]
2021-09-20 7:44 ` [PATCH] drm/radeon: fix uninitialized bool variable Christian König
2021-09-20 16:00 ` Alex Deucher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210918094157.4770-1-yangzhiwei@uniontech.com \
--to=yangzhiwei@uniontech.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).