Skip to contentSkip to conversation

drm/amd/display: Fix unused variable warning

PATCH In review Tim Huang 4 participants 4 messages Jan 27, 2022

Subsystems (3)
lore
Share & tools
lore

Tim Huang

author
#0 lore raw

PATCH 1/1 drm/amd/display: Fix unused variable warning

[Why]
It will build failed with unused variable 'dc' with '-Werror=unused-variable'enabled when CONFIG_DRM_AMD_DC_DCN is not defined.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -2
index 1057f976bec7..8f53c9f6b267 100644
@@ -1027,7 +1027,6 @@ static int dm_dmub_hw_init(struct amdgpu_device *adev)
 	const unsigned char *fw_inst_const, *fw_bss_data;
 	uint32_t i, fw_inst_const_size, fw_bss_data_size;
 	bool has_hw_support;
-	struct dc *dc = adev->dm.dc;
 
 	if (!dmub_srv)
 		/* DMUB isn't supported on the ASIC. */
@@ -1123,7 +1122,7 @@ static int dm_dmub_hw_init(struct amdgpu_device *adev)
 	case IP_VERSION(3, 1, 3): /* Only for this asic hw internal rev B0 */
 		hw_params.dpia_supported = true;
 #if defined(CONFIG_DRM_AMD_DC_DCN)
-		hw_params.disable_dpia = dc->debug.dpia_debug.bits.disable_dpia;
+		hw_params.disable_dpia = adev->dm.dc->debug.dpia_debug.bits.disable_dpia;
 #endif
 		break;
 	default:
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 35 lines · Tim Huang

[Why]
It will build failed with unused variable 'dc' with '-Werror=unused-variable'enabled when CONFIG_DRM_AMD_DC_DCN is not defined.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -3
index 1057f976bec7..8f53c9f6b267 100644
@@ -1027,7 +1027,6 @@ static int dm_dmub_hw_init(struct amdgpu_device *adev)
        const unsigned char *fw_inst_const, *fw_bss_data;
        uint32_t i, fw_inst_const_size, fw_bss_data_size;
        bool has_hw_support;
-       struct dc *dc = adev->dm.dc;
 
        if (!dmub_srv)
                /* DMUB isn't supported on the ASIC. */
@@ -1123,7 +1122,7 @@ static int dm_dmub_hw_init(struct amdgpu_device *adev)
        case IP_VERSION(3, 1, 3): /* Only for this asic hw internal rev B0 */
                hw_params.dpia_supported = true;
 #if defined(CONFIG_DRM_AMD_DC_DCN)
-               hw_params.disable_dpia = dc->debug.dpia_debug.bits.disable_dpia;
+               hw_params.disable_dpia = adev->dm.dc->debug.dpia_debug.bits.disable_dpia;
 #endif
                break;
        default:
--

2.25.1

Reviewed-by on v1 1/1
#2 lore raw
In reply to Tim Huang

[AMD Official Use Only]

--
Best Regards
Aaron Liu

Quoted 45 lines

-----Original Message-----
From: Huang, Tim <[email protected]>
Sent: Thursday, January 27, 2022 11:34 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Huang, Ray <[email protected]>; Liu, Aaron <[email protected]>; Huang, Tim <[email protected]>
Subject: [PATCH] drm/amd/display: Fix unused variable warning

[Why]
It will build failed with unused variable 'dc' with '-Werror=unused- variable'enabled when CONFIG_DRM_AMD_DC_DCN is not defined.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -1
index 1057f976bec7..8f53c9f6b267 100644
@@ -1027,7 +1027,6 @@ static int dm_dmub_hw_init(struct
 amdgpu_device *adev)
 	const unsigned char *fw_inst_const, *fw_bss_data;
 	uint32_t i, fw_inst_const_size, fw_bss_data_size;
 	bool has_hw_support;
-	struct dc *dc = adev->dm.dc;
 
 	if (!dmub_srv)

/* DMUB isn't supported on the ASIC. */ @@ -1123,7 +1122,7
@@ static int dm_dmub_hw_init(struct amdgpu_device *adev)

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -1
 	case IP_VERSION(3, 1, 3): /* Only for this asic hw internal rev B0 */
 		hw_params.dpia_supported = true;
 #if defined(CONFIG_DRM_AMD_DC_DCN)
-		hw_params.disable_dpia = dc-
Quoted 1 line

debug.dpia_debug.bits.disable_dpia;

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
+		hw_params.disable_dpia =
+adev->dm.dc->debug.dpia_debug.bits.disable_dpia;
 #endif
 		break;
 	default:
--

2.25.1

Reviewed-by on v1 1/1
#3 lore raw
In reply to Tim Huang
Quoted 6 lines · Tim

[Why]
It will build failed with unused variable 'dc' with '-Werror=unused-variable'enabled when CONFIG_DRM_AMD_DC_DCN is not defined.

Quoted 28 lines
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -2
index 1057f976bec7..8f53c9f6b267 100644
@@ -1027,7 +1027,6 @@ static int dm_dmub_hw_init(struct amdgpu_device *adev)
 	const unsigned char *fw_inst_const, *fw_bss_data;
 	uint32_t i, fw_inst_const_size, fw_bss_data_size;
 	bool has_hw_support;
-	struct dc *dc = adev->dm.dc;
 
 	if (!dmub_srv)
 		/* DMUB isn't supported on the ASIC. */
@@ -1123,7 +1122,7 @@ static int dm_dmub_hw_init(struct amdgpu_device *adev)
 	case IP_VERSION(3, 1, 3): /* Only for this asic hw internal rev B0 */
 		hw_params.dpia_supported = true;
 #if defined(CONFIG_DRM_AMD_DC_DCN)
-		hw_params.disable_dpia = dc->debug.dpia_debug.bits.disable_dpia;
+		hw_params.disable_dpia = adev->dm.dc->debug.dpia_debug.bits.disable_dpia;
 #endif
 		break;
 	default:
Signature · 1 line
2.25.1