[PATCH -next] drm/amd/display: Delete redundant null check for 'steam' and 'plane'

Wang Wensheng wangwensheng4 at huawei.com
Fri Aug 30 03:41:03 UTC 2024


Since commit 15c2990e0f01 ("drm/amd/display: Add null checks for
'stream' and 'plane' before dereferencing"), the
dcn30_apply_idle_power_optimizations() function would return
if these veriables would be null. So no need to check again before
using them.

Signed-off-by: Wang Wensheng <wangwensheng4 at huawei.com>
---
 drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c
index eaeeade31ed7..ffc35a5653fd 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c
@@ -925,11 +925,9 @@ bool dcn30_apply_idle_power_optimizations(struct dc *dc, bool enable)
 			if (!stream || !plane)
 				return false;
 
-			if (stream && plane) {
-				cursor_cache_enable = stream->cursor_position.enable &&
-						plane->address.grph.cursor_cache_addr.quad_part;
-				cursor_attr = stream->cursor_attributes;
-			}
+			cursor_cache_enable = stream->cursor_position.enable &&
+					plane->address.grph.cursor_cache_addr.quad_part;
+			cursor_attr = stream->cursor_attributes;
 
 			/*
 			 * Second, check MALL eligibility
-- 
2.17.1



More information about the dri-devel mailing list