drm/amd/display: Remove redundant checks for opp
authorAlex Hung <alex.hung@amd.com>
Fri, 7 Jun 2024 16:59:55 +0000 (10:59 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 19 Jun 2024 16:45:54 +0000 (12:45 -0400)
The null checks for opp are redundant as they were 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>
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c
drivers/gpu/drm/amd/display/dc/hwss/dcn201/dcn201_hwseq.c

index 0bfab66b8038d356edf34b660f5990fdd0a57c25..35151dd056cb8887d2d8ee7267007949ad36ddb1 100644 (file)
@@ -1260,7 +1260,7 @@ void dcn10_plane_atomic_disconnect(struct dc *dc,
        mpc->funcs->remove_mpcc(mpc, mpc_tree_params, mpcc_to_remove);
        // Phantom pipes have OTG disabled by default, so MPCC_STATUS will never assert idle,
        // so don't wait for MPCC_IDLE in the programming sequence
-       if (opp != NULL && dc_state_get_pipe_subvp_type(state, pipe_ctx) != SUBVP_PHANTOM)
+       if (dc_state_get_pipe_subvp_type(state, pipe_ctx) != SUBVP_PHANTOM)
                opp->mpcc_disconnect_pending[pipe_ctx->plane_res.mpcc_inst] = true;
 
        dc->optimized_required = true;
index f96adc689055cc1a15d8109d12b212acc61e6e27..1635e5a552ad2792d029306f8b797d26598b8c18 100644 (file)
@@ -408,8 +408,7 @@ void dcn201_plane_atomic_disconnect(struct dc *dc,
        if (mpcc_removed == false)
                return;
 
-       if (opp != NULL)
-               opp->mpcc_disconnect_pending[pipe_ctx->plane_res.mpcc_inst] = true;
+       opp->mpcc_disconnect_pending[pipe_ctx->plane_res.mpcc_inst] = true;
 
        dc->optimized_required = true;