]> git.dujemihanovic.xyz Git - linux.git/commitdiff
drm/amd/display: Simplify the calculation of variables
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Fri, 12 May 2023 07:04:51 +0000 (15:04 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Jun 2023 13:38:57 +0000 (09:38 -0400)
./drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c:586:37-39: WARNING !A || A && B is equivalent to !A || B.
./drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c:595:37-39: WARNING !A || A && B is equivalent to !A || B.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4941
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c

index 4950eaa4406b2bdb72d3d4d9e2f25f497ac0d2d9..2de910e0ce75f60ce39f10ea4d151ec1693a868a 100644 (file)
@@ -583,8 +583,8 @@ void dcn32_update_force_pstate(struct dc *dc, struct dc_state *context)
                struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
                struct hubp *hubp = pipe->plane_res.hubp;
 
-               if (!pipe->stream || (pipe->stream && !(pipe->stream->mall_stream_config.type == SUBVP_MAIN ||
-                                               pipe->stream->fpo_in_use))) {
+               if (!pipe->stream || !(pipe->stream->mall_stream_config.type == SUBVP_MAIN ||
+                   pipe->stream->fpo_in_use)) {
                        if (hubp && hubp->funcs->hubp_update_force_pstate_disallow)
                                hubp->funcs->hubp_update_force_pstate_disallow(hubp, false);
                }
@@ -592,7 +592,7 @@ void dcn32_update_force_pstate(struct dc *dc, struct dc_state *context)
                /* Today only FPO uses cursor P-State force. Only clear cursor P-State force
                 * if it's not FPO.
                 */
-               if (!pipe->stream || (pipe->stream && !pipe->stream->fpo_in_use)) {
+               if (!pipe->stream || !pipe->stream->fpo_in_use) {
                        if (hubp && hubp->funcs->hubp_update_force_cursor_pstate_disallow)
                                hubp->funcs->hubp_update_force_cursor_pstate_disallow(hubp, false);
                }