aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMario Limonciello <mario.limonciello@amd.com>2025-02-28 13:32:57 -0600
committerAlex Deucher <alexander.deucher@amd.com>2025-03-10 13:35:49 -0400
commit272385483e0b1cadfeae03548fb8798d178f13d9 (patch)
tree69b4b651d78df93cc16710b8300b7a626c73ad6a
parentdrm/amd/display: Add scoped mutexes for amdgpu_dm_dhcp (diff)
downloadwireguard-linux-272385483e0b1cadfeae03548fb8798d178f13d9.tar.xz
wireguard-linux-272385483e0b1cadfeae03548fb8798d178f13d9.zip
drm/amd/display: Drop unnecessary ret variable for enable_assr()
[Why] enable_assr() has a res variable that only is changed in one block with no cleanup necessary. [How] Remove variable and return early from failure cases. Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Tom Chung <chiahsuan.chung@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
index 6f8f21e123c8..a3e93b2891f0 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
@@ -457,7 +457,6 @@ static bool enable_assr(void *handle, struct dc_link *link)
struct mod_hdcp hdcp = hdcp_work->hdcp;
struct psp_context *psp = hdcp.config.psp.handle;
struct ta_dtm_shared_memory *dtm_cmd;
- bool res = true;
if (!psp->dtm_context.context.initialized) {
DRM_INFO("Failed to enable ASSR, DTM TA is not initialized.");
@@ -478,10 +477,10 @@ static bool enable_assr(void *handle, struct dc_link *link)
if (dtm_cmd->dtm_status != TA_DTM_STATUS__SUCCESS) {
DRM_INFO("Failed to enable ASSR");
- res = false;
+ return false;
}
- return res;
+ return true;
}
static void update_config(void *handle, struct cp_psp_stream_config *config)