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 <wangwenshe...@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

Reply via email to