diff options
author | 2024-06-07 10:46:35 -0600 | |
---|---|---|
committer | 2024-06-19 12:46:08 -0400 | |
commit | 391c6fb490b069b4f7c4620675c98f2d6073e050 (patch) | |
tree | ac5bd0c7db12d66989ed12c202874da10166f7f0 /drivers/gpu | |
parent | drm/amd/display: Remove redundant checks for opp (diff) | |
download | wireguard-linux-391c6fb490b069b4f7c4620675c98f2d6073e050.tar.xz wireguard-linux-391c6fb490b069b4f7c4620675c98f2d6073e050.zip |
drm/amd/display: Remove redundant checks for context
The null checks for context are redundant as it was already
dereferenced previously, as reported by Coverity; therefore
the null checks are removed.
This fixes 2 REVERSE_INULL issues reported by Coverity.
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.c | 5 |
2 files changed, 2 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c index 33318a112282..5037474bf95c 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c @@ -505,7 +505,7 @@ void set_p_state_switch_method( struct vba_vars_st *vba = &context->bw_ctx.dml.vba; bool enable_subvp; - if (!dc->ctx || !dc->ctx->dmub_srv || !pipe_ctx || !vba || !context) + if (!dc->ctx || !dc->ctx->dmub_srv || !pipe_ctx || !vba) return; if (vba->DRAMClockChangeSupport[vba->VoltageLevel][vba->maxMpcComb] != diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.c b/drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.c index b0de4ae9a50f..f6310408dbba 100644 --- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.c +++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.c @@ -573,10 +573,7 @@ static bool dml2_validate_and_build_resource(const struct dc *in_dc, struct dc_s bool need_recalculation = false; uint32_t cstate_enter_plus_exit_z8_ns; - if (!context) - return true; - - else if (context->stream_count == 0) { + if (context->stream_count == 0) { unsigned int lowest_state_idx = 0; out_clks.p_state_supported = true; |