Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3813299pxb; Tue, 10 Nov 2020 00:06:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTjgwYxa5uDwSPYXEMV9tVFHdCjj+ZVDbx0X9qGwxRvFXDoReeNUli2W0RjwBgQCs8xWak X-Received: by 2002:a50:a105:: with SMTP id 5mr11779676edj.165.1604995559849; Tue, 10 Nov 2020 00:05:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604995559; cv=none; d=google.com; s=arc-20160816; b=EK/vtG6exFkorulx1k3kfQd0R6qjwCXQRGys/vCC65YeZs3pBuXGuhu+0OBSh6CtK/ mXga1FLQWiG1bI2NX9x6EUWR1k+GQ42B7enrb9ObU/i7QzIffeeKbErzJKqe0YESsg8Q f3R8tR6Gp2IUyarPkrLESEiJDNlPzBwNQWczbkTsutun/I02BBj4Wl+rMmUrKUFJUo+G 5mMpNfNmU7vTXjiVkmw0xW5rro8I7M239LnXSb0IzFNgO+m9PKXgH0hT+BqzOG8NNVhj 1o5TbdGchfoyAJHYcDUS6xF1GeN03Y4iBJeN6RY6XAIRP3G1uSYCCUa383ydsErLozEK FazA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=fL9nFTgOlrUDraJl0oZsnBuY0ll++n2Y8w0UkvrB4XU=; b=t3iJy4TN0pQ1IsMWdU9KqgdhOoiKnF+uUAxwXnnKwEemdiiI+vnIuOITjIqoqm7AYO sUrTRHqlb4gs5gUMc/8Fo99+yPA/RtaC/nCd5ncOoqJmtVEjKXK78ze0Ru6dE1EVaq6x in2J2gHGBPbACU/cetM6k13a6mwXj67EJSavl/ku8nMr5tCbvFjaKXDwiyjLszH0JuX4 TfmtSDOzbmZdwtUa3nmmsdPdT5Qtd2ygdo6RlYjfHDiVGmU7G5uC+5gc1SyldzD6dPJa zbHj9WRWRXYH71BEWWdm/+ob23znukS3CbyPm0TAI2WrSmRO/uFa3T8tq8czjtDA/5M6 I3Mg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vivo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a5si7246912edu.121.2020.11.10.00.05.37; Tue, 10 Nov 2020 00:05:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729024AbgKJIDa (ORCPT + 99 others); Tue, 10 Nov 2020 03:03:30 -0500 Received: from m176115.mail.qiye.163.com ([59.111.176.115]:21877 "EHLO m176115.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726213AbgKJIDa (ORCPT ); Tue, 10 Nov 2020 03:03:30 -0500 Received: from ubuntu.localdomain (unknown [157.0.31.124]) by m176115.mail.qiye.163.com (Hmail) with ESMTPA id 287A8667105; Tue, 10 Nov 2020 16:03:25 +0800 (CST) From: Bernard Zhao To: Harry Wentland , Leo Li , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Airlie , Daniel Vetter , Nicholas Kazlauskas , Rodrigo Siqueira , Mikita Lipski , Stylon Wang , Bhawanpreet Lakha , Roman Li , hersen wu , Aurabindo Pillai , Alexander Monakov , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Bernard Zhao Subject: [PATCH] amd/display/amdgpu_dm: delete same check in if condition Date: Tue, 10 Nov 2020 00:03:13 -0800 Message-Id: <20201110080318.36305-1-bernard@vivo.com> X-Mailer: git-send-email 2.29.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZS1VLWVdZKFlBSE83V1ktWUFJV1kPCR oVCBIfWUFZGENJSkJMSE9LGh5DVkpNS09CQk5PS05OS0tVEwETFhoSFyQUDg9ZV1kWGg8SFR0UWU FZT0tIVUpKS09ISFVLWQY+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6NE06Vgw*MD8tShEKDi0eEh8M IRAKCRZVSlVKTUtPQkJOT0tNS01JVTMWGhIXVRkeCRUaCR87DRINFFUYFBZFWVdZEgtZQVlKTkxV S1VISlVKSU9ZV1kIAVlBSUJNQjcG X-HM-Tid: 0a75b12e56aa9373kuws287a8667105 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In function amdgpu_dm_connector_get_modes, drm_edid_is_valid will check weather (!edid), no need to check again in the if branch. Signed-off-by: Bernard Zhao --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index e93e18c06c0e..0a283d07fe10 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -6352,7 +6352,7 @@ static int amdgpu_dm_connector_get_modes(struct drm_connector *connector) encoder = amdgpu_dm_connector_to_encoder(connector); - if (!edid || !drm_edid_is_valid(edid)) { + if (!drm_edid_is_valid(edid)) { amdgpu_dm_connector->num_modes = drm_add_modes_noedid(connector, 640, 480); } else { -- 2.29.0