Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1174333pxk; Mon, 31 Aug 2020 11:50:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8YPvs3tRzkWakj0tZ9T4Z+7jHPoPEDEkedeLpuio4u7yvubEwWL2b4pdivelTCwPb+UqJ X-Received: by 2002:aa7:c597:: with SMTP id g23mr2554715edq.172.1598899853551; Mon, 31 Aug 2020 11:50:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598899853; cv=none; d=google.com; s=arc-20160816; b=Qo3iy2VLappVllUE+n9sHPmad9peimvU1AdcBTzLgUqxFQR+37WMGkfM03gswD3YIp IW+7JhbXtx/FWOOzlIIgeWeF0oRj2u/GQYA10DV2dWnYluu9PpNCIQYc4Or0oEtPSch4 +4r6wu/8i/YSX1yBtVrPwaoPWutgCc6BjVki18WU5drjir9IS72Q5m2mB1eTV7i3+29k 4X8PR6TLxV3qnoO4hJrRk68A5WJnn0Z2l6GwzwbzJhnaN76oM0tqW/ZTmwNwfzuf+zg+ rT+5x1MxA6tb6pyn0th+SwHdbsY/+jVVDLGCrviktXsQNi/0IVRHj4xX+5RMhC/ZFNgx tK6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qAVVHF1IMv4iayuuFXHyFLgFhfYW1iNXcSUFWXR2IR0=; b=cflVirn7vh5BlUmuU41L8/woDuqFTDZ7n8k+4sMNgEllqpOTd1H+lxRET3mIc0Ly9u AVGN2WjFvgIgU3P7o+TTMMqmQXZbqjvSq4JdnW92cgxlhOPV91eRAwfDKE6J/I6PT/Cy iwCs7b6ybTXsX2CBzA8Wlaq5rh6I+cDk57Ch33dipQlgQ4fbvFPjHOBCYDSxBwI+/Cgx R769BJwQzKRnfMsaZrfe1+u239ljKFsmHzYyFFsV8gydUmVetVHYkm5kIz2RbITM4l8B rS/NzWZnCCrf5uMATd52Q+xK80a4/XhjppSEVeqti9GwbzYfMLKL5mOZXEH3BTSBsWV3 y5+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Z0noHzwb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s15si6191114eju.232.2020.08.31.11.50.30; Mon, 31 Aug 2020 11:50:53 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Z0noHzwb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728695AbgHaPai (ORCPT + 99 others); Mon, 31 Aug 2020 11:30:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:39708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728612AbgHaPaY (ORCPT ); Mon, 31 Aug 2020 11:30:24 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B3A6A207EA; Mon, 31 Aug 2020 15:30:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598887823; bh=SjN8iminpZiXmeBHQ3gKw/eRxDZLxp1Xr4nXn7Ml+q8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z0noHzwbiA1bMrbUdSrDR0sDcKVByvEvKcLdzopp3gg72X1YnFYRn1j/JtHfO5Jan 1RQ9ZJLmYUJOmGh9jSDUGBL8SziNlS5NCBqekoZLc9zSRm1ZZgdl2BorI7CO4XTRAW 4H1ER9uJkIb8Mn8eSgKeyMh6fn1R6JGtGydR/gYY= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tong Zhang , Alex Deucher , Sasha Levin , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.8 33/42] drm/amd/display: should check error using DC_OK Date: Mon, 31 Aug 2020 11:29:25 -0400 Message-Id: <20200831152934.1023912-33-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200831152934.1023912-1-sashal@kernel.org> References: <20200831152934.1023912-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tong Zhang [ Upstream commit ed9ab229fea24cbcab17f484297dc8344afb7ea9 ] core_link_read_dpcd returns only DC_OK(1) and DC_ERROR_UNEXPECTED(-1), the caller should check error using DC_OK instead of checking against 0 Signed-off-by: Tong Zhang Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 91cd884d6f257..7728fd71d1f3a 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 @@ -4346,9 +4346,9 @@ bool dc_link_get_backlight_level_nits(struct dc_link *link, link->connector_signal != SIGNAL_TYPE_DISPLAY_PORT)) return false; - if (!core_link_read_dpcd(link, DP_SOURCE_BACKLIGHT_CURRENT_PEAK, + if (core_link_read_dpcd(link, DP_SOURCE_BACKLIGHT_CURRENT_PEAK, dpcd_backlight_get.raw, - sizeof(union dpcd_source_backlight_get))) + sizeof(union dpcd_source_backlight_get)) != DC_OK) return false; *backlight_millinits_avg = @@ -4387,9 +4387,9 @@ bool dc_link_read_default_bl_aux(struct dc_link *link, uint32_t *backlight_milli link->connector_signal != SIGNAL_TYPE_DISPLAY_PORT)) return false; - if (!core_link_read_dpcd(link, DP_SOURCE_BACKLIGHT_LEVEL, + if (core_link_read_dpcd(link, DP_SOURCE_BACKLIGHT_LEVEL, (uint8_t *) backlight_millinits, - sizeof(uint32_t))) + sizeof(uint32_t)) != DC_OK) return false; return true; -- 2.25.1