From: Andrey Vatoropin Date: Wed, 2 Apr 2025 14:21:39 +0000 (+0000) Subject: drm/amd/display: Remove the redundant NULL check X-Git-Tag: v6.16-rc1~144^2~10^2~383 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d53a64e9ee58c3567955db6147d34f00c90065ed;p=thirdparty%2Flinux.git drm/amd/display: Remove the redundant NULL check 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 Signed-off-by: Andrey Vatoropin Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c index f01ced0150726..f040c22db59bb 100644 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c @@ -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)