From patchwork Fri Aug 30 03:41:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Wensheng X-Patchwork-Id: 13784412 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6651BCA0EE6 for ; Fri, 30 Aug 2024 07:15:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3E8AC10E826; Fri, 30 Aug 2024 07:15:41 +0000 (UTC) X-Greylist: delayed 946 seconds by postgrey-1.36 at gabe; Fri, 30 Aug 2024 04:10:18 UTC Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by gabe.freedesktop.org (Postfix) with ESMTPS id A6C1A10E143; Fri, 30 Aug 2024 04:10:18 +0000 (UTC) Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Ww45d4QKPz1j7gj; Fri, 30 Aug 2024 11:54:13 +0800 (CST) Received: from kwepemd200012.china.huawei.com (unknown [7.221.188.145]) by mail.maildlp.com (Postfix) with ESMTPS id EC8E01A0188; Fri, 30 Aug 2024 11:54:26 +0800 (CST) Received: from huawei.com (10.175.112.208) by kwepemd200012.china.huawei.com (7.221.188.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.34; Fri, 30 Aug 2024 11:54:25 +0800 From: Wang Wensheng To: , , , , , , , , , , , , , , , , , CC: Subject: [PATCH -next] drm/amd/display: Delete redundant null check for 'steam' and 'plane' Date: Fri, 30 Aug 2024 11:41:03 +0800 Message-ID: <20240830034103.121722-1-wangwensheng4@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.175.112.208] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemd200012.china.huawei.com (7.221.188.145) X-Mailman-Approved-At: Fri, 30 Aug 2024 07:15:39 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 --- 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