Skip to contentSkip to conversation

drm/amd/display: fix mixed declaration and code

PATCH In review Alex Deucher 2 participants 2 messages Dec 1, 2021

Subsystems (3)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amd/display: fix mixed declaration and code

Reorder the code to fix the warning.

Fixes 8808f3ffb14d79 ("drm/amd/display: Add DP-HDMI FRL PCON Support in DC")
Cc Fangzhi Zuo <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +2 -2
index 66dacde7a7cc..62510b643882 100644
@@ -4684,12 +4684,12 @@ static void get_active_converter_info(
 
 #if defined(CONFIG_DRM_AMD_DC_DCN)
 					if (link->dc->caps.hdmi_frl_pcon_support) {
+						union hdmi_encoded_link_bw hdmi_encoded_link_bw;
+
 						link->dpcd_caps.dongle_caps.dp_hdmi_frl_max_link_bw_in_kbps =
 								dc_link_bw_kbps_from_raw_frl_link_rate_data(
 										hdmi_color_caps.bits.MAX_ENCODED_LINK_BW_SUPPORT);
 
-						union hdmi_encoded_link_bw hdmi_encoded_link_bw;
-
 						// Intersect reported max link bw support with the supported link rate post FRL link training
 						if (core_link_read_dpcd(link, DP_PCON_HDMI_POST_FRL_STATUS,
 								&hdmi_encoded_link_bw.raw, sizeof(hdmi_encoded_link_bw)) == DC_OK) {
Signature · 1 line
2.31.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Alex Deucher

Reorder the code to fix the warning.

Fixes 8808f3ffb14d79 ("drm/amd/display: Add DP-HDMI FRL PCON Support in DC")
Cc Fangzhi Zuo <[email protected]>

Harry

Quoted 24 lines
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +2 -2
index 66dacde7a7cc..62510b643882 100644
@@ -4684,12 +4684,12 @@ static void get_active_converter_info(
 
 #if defined(CONFIG_DRM_AMD_DC_DCN)
 					if (link->dc->caps.hdmi_frl_pcon_support) {
+						union hdmi_encoded_link_bw hdmi_encoded_link_bw;
+
 						link->dpcd_caps.dongle_caps.dp_hdmi_frl_max_link_bw_in_kbps =
 								dc_link_bw_kbps_from_raw_frl_link_rate_data(
 										hdmi_color_caps.bits.MAX_ENCODED_LINK_BW_SUPPORT);
 
-						union hdmi_encoded_link_bw hdmi_encoded_link_bw;
-
 						// Intersect reported max link bw support with the supported link rate post FRL link training
 						if (core_link_read_dpcd(link, DP_PCON_HDMI_POST_FRL_STATUS,
 								&hdmi_encoded_link_bw.raw, sizeof(hdmi_encoded_link_bw)) == DC_OK) {