Commit 4b22869f authored by Wenjing Liu's avatar Wenjing Liu Committed by Alex Deucher

drm/amd/display: Remove a redundant check in authenticated_dp

[WHY]
mod_hdcp_execute_and_set returns (*status == MOD_HDCP_STATUS_SUCCESS).
When it return 0, it is guaranteed that status == MOD_HDCP_STATUS_SUCCESS
will be evaluated as false. Since now we are using goto out already, all 3
if (status == MOD_HDCP_STATUS_SUCCESS) clauses are guaranteed to enter.
Therefore we are removing the if statements due to redundancy.
Reviewed-by: default avatarRodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: default avatarAlex Hung <alex.hung@amd.com>
Signed-off-by: default avatarWenjing Liu <wenjing.liu@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0b8de7a0
...@@ -432,21 +432,18 @@ static enum mod_hdcp_status authenticated_dp(struct mod_hdcp *hdcp, ...@@ -432,21 +432,18 @@ static enum mod_hdcp_status authenticated_dp(struct mod_hdcp *hdcp,
goto out; goto out;
} }
if (status == MOD_HDCP_STATUS_SUCCESS) if (!mod_hdcp_execute_and_set(mod_hdcp_read_bstatus,
if (!mod_hdcp_execute_and_set(mod_hdcp_read_bstatus, &input->bstatus_read, &status,
&input->bstatus_read, &status, hdcp, "bstatus_read"))
hdcp, "bstatus_read")) goto out;
goto out; if (!mod_hdcp_execute_and_set(check_link_integrity_dp,
if (status == MOD_HDCP_STATUS_SUCCESS) &input->link_integrity_check, &status,
if (!mod_hdcp_execute_and_set(check_link_integrity_dp, hdcp, "link_integrity_check"))
&input->link_integrity_check, &status, goto out;
hdcp, "link_integrity_check")) if (!mod_hdcp_execute_and_set(check_no_reauthentication_request_dp,
goto out; &input->reauth_request_check, &status,
if (status == MOD_HDCP_STATUS_SUCCESS) hdcp, "reauth_request_check"))
if (!mod_hdcp_execute_and_set(check_no_reauthentication_request_dp, goto out;
&input->reauth_request_check, &status,
hdcp, "reauth_request_check"))
goto out;
out: out:
return status; return status;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment