From nobody Sun Feb 8 19:35:40 2026 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0EA3213049E for ; Fri, 30 Aug 2024 03:54:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724990073; cv=none; b=hdWMkvqEi/WnpXeVbTSScAJVCqV9biUIqGqgEFEVtGXbkZwaA5sOGCxd7vuX4GH7P5hZuoi4mJc3xFrKK+k0drJxEn0GVWtyRYNXruAy60qaRi2tO2gHFfA8ss2NORxRuez8lCVp3njugVZqwOkEZROkEO2ADj/KHe5oE6eMSRI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724990073; c=relaxed/simple; bh=OfDTFjf/h2wvTgjbGH6TLB03gGgubM6ndEfZYh9agqY=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=psFx/9tKMOgn8rjgdpKqY5VZLS+C+dcxIfjWHoPECMHPbZjU+zCLKnnh4BIv65bhl/LevDU1MzORmm78qrks2veYmBQnRNs+Pp0S2Uq+qTyEMTdN1YJ8IFFhzPaFMFj2CNjGPgI5r90TfpBzmVFnX23QPzukUh3rhuPwlOu8lDU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemd200012.china.huawei.com (7.221.188.145) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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/driv= ers/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 *d= c, bool enable) if (!stream || !plane) return false; =20 - if (stream && plane) { - cursor_cache_enable =3D stream->cursor_position.enable && - plane->address.grph.cursor_cache_addr.quad_part; - cursor_attr =3D stream->cursor_attributes; - } + cursor_cache_enable =3D stream->cursor_position.enable && + plane->address.grph.cursor_cache_addr.quad_part; + cursor_attr =3D stream->cursor_attributes; =20 /* * Second, check MALL eligibility --=20 2.17.1