]> git.hungrycats.org Git - linux/commitdiff
drm/amd/display: Remove unused-but-set variable hubp from
authorGleb Markov <markov.gi@npc-ksb.ru>
Mon, 29 Jun 2026 13:09:06 +0000 (16:09 +0300)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 15 Jul 2026 13:15:43 +0000 (09:15 -0400)
The final check of hubp for NULL covers all remaining lines of code, since
the value of hubp does not change until the end of the method.

This check is redundant because hubp1 is already dereferenced within the
macro.
If it were NULL, the program would have already failed to proceed.

Remove the left part of the expression with the logical "&&".

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: be1fb44389ca ("drm/amd/display: Check null pointers before used").
Signed-off-by: Gleb Markov <markov.gi@npc-ksb.ru>
Reviewed-by: George Zhang <george.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/hubp/dcn10/dcn10_hubp.c

index 7c97a774141ff045f16000084dc7641851d3f79e..d8eb5996b57745472dd2a0a454af263bf27dc69f 100644 (file)
@@ -772,8 +772,7 @@ bool hubp1_is_flip_pending(struct hubp *hubp)
        if (flip_pending)
                return true;
 
-       if (hubp &&
-           earliest_inuse_address.grph.addr.quad_part != hubp->request_address.grph.addr.quad_part)
+       if (earliest_inuse_address.grph.addr.quad_part != hubp->request_address.grph.addr.quad_part)
                return true;
 
        return false;