Skip to content

Commit

Permalink
drm/amd/display: Remove the redundant NULL check
Browse files Browse the repository at this point in the history
Static analysis shows that pointer "timing" cannot be NULL because it
points to the object "struct dc_crtc_timing".

Remove the extra NULL check. It is meaningless and harms the readability
of the code.

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

Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Andrey Vatoropin <a.vatoropin@crpt.ru>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Andrey Vatoropin authored and Alex Deucher committed Apr 7, 2025
1 parent 5df0d6a commit d53a64e
Showing 1 changed file with 0 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1891,8 +1891,6 @@ static int get_refresh_rate(struct dc_state *context)

/* check if refresh rate at least 120hz */
timing = &context->streams[0]->timing;
if (timing == NULL)
return 0;

h_v_total = timing->h_total * timing->v_total;
if (h_v_total == 0)
Expand Down

0 comments on commit d53a64e

Please sign in to comment.