Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp44618pxj; Wed, 16 Jun 2021 19:50:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGev9WA44j0C81vCE/WQrgmuTFTWModU79JZf9GzlO4XvrnNJhwtNoSX6f6eciVG8IBieV X-Received: by 2002:aa7:d818:: with SMTP id v24mr3440882edq.22.1623898208187; Wed, 16 Jun 2021 19:50:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623898208; cv=none; d=google.com; s=arc-20160816; b=AZ4/KmlHPUy+AeO+Tec07VWgushf0Sk+erFmIs4v5pHKwls2kiJkn9wmn2XnRuTctY Ex72AC6yYRnPx3VqkTMVMQiC4hvrKzJOOzWVPq+2n/BdpbPNkRbh6BGpqTNIC+fUS+Ez GhoR1ako1lzEbSQaxxjMxyem/QGwNz7hO/aBVRfYsqkzt+DyE715dpqzYjaCKtwWy23L J225IAxAmCWiFPj9o4aKChpuBqr7fqi2x4GcJy7oEXJghUbQOjJ6m+UhaUAE8z7osos6 ihWr5A/aRUozXJ6HLHzbDR1RIT2SyY0WJOOM/cZnVoglvpy7E5+OgKgp8oSSnkXqu0jE XOTw== 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=BEb+xbSxeIyh98uuLuWhvIzoZ0VIHLjjadAVQnLYlWY=; b=ogc9IN20+IxXuOhxQmxUZqflAhbAONJUY5Y2eUF0T7IyiNlkSNQl4ydop2q5oXzs3o /cA0DwaKvbF//C0Fuh8Dh4RcbWo18Zqe+7COYpKs3At7PcNtmcWXdv4nI6Fw1y8+PdIP ei2dK2LCoot3/jA38IZR21E0Nao5/dEcJCzBgiDnDnT2kr1rVViR4gce0mQQ1BvvH0yp IyHl9VLXPJaDZQd7qIlKIw/EQLZgLZpADODkXE62w4R3SgEDl5GPKxBElxWhy5dAQaHp PfW9inx9ZdcGDNt2GWskVPmvht7BSB8hNuHdUBvX6syiT47kA7AJeWz+Xqott3nrA4JA 8ldw== 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=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v11si4087888eju.491.2021.06.16.19.49.45; Wed, 16 Jun 2021 19:50:08 -0700 (PDT) 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=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231684AbhFQCc2 (ORCPT + 99 others); Wed, 16 Jun 2021 22:32:28 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:7336 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231572AbhFQCc1 (ORCPT ); Wed, 16 Jun 2021 22:32:27 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4G55XB3lMfz6ySF; Thu, 17 Jun 2021 10:26:18 +0800 (CST) Received: from dggpemm500019.china.huawei.com (7.185.36.180) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 17 Jun 2021 10:30:17 +0800 Received: from ubuntu1804.huawei.com (10.67.174.98) by dggpemm500019.china.huawei.com (7.185.36.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 17 Jun 2021 10:30:17 +0800 From: Pu Lehui To: , , , , , , , , , , , , , , , CC: , , , , Subject: [PATCH -next] drm/amd/display: Fix gcc unused variable warning Date: Thu, 17 Jun 2021 10:31:09 +0800 Message-ID: <20210617023109.204591-1-pulehui@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.174.98] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500019.china.huawei.com (7.185.36.180) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org GCC reports the following warning with W=1: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:3635:17: warning: variable ‘status’ set but not used [-Wunused-but-set-variable] 3635 | enum dc_status status = DC_ERROR_UNEXPECTED; | ^~~~~~ The variable should be used for error check, let's fix it. Signed-off-by: Pu Lehui --- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c index fcb635c85330..cf29265870c8 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c @@ -3681,6 +3681,10 @@ bool dp_retrieve_lttpr_cap(struct dc_link *link) DP_LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV, lttpr_dpcd_data, sizeof(lttpr_dpcd_data)); + if (status != DC_OK) { + dm_error("%s: Read LTTPR caps data failed.\n", __func__); + return false; + } link->dpcd_caps.lttpr_caps.revision.raw = lttpr_dpcd_data[DP_LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV - -- 2.17.1