[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADnq5_NDMZp9-1vVZ_CuxPJmxF8c1ULNbVmuMD6V9C3QT=OsmQ@mail.gmail.com>
Date: Tue, 18 Aug 2020 10:56:10 -0400
From: Alex Deucher <alexdeucher@...il.com>
To: Tong Zhang <ztong0001@...il.com>
Cc: "Wentland, Harry" <harry.wentland@....com>,
"Leo (Sunpeng) Li" <sunpeng.li@....com>,
"Deucher, Alexander" <alexander.deucher@....com>,
Christian Koenig <christian.koenig@....com>,
Dave Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
"Siqueira, Rodrigo" <Rodrigo.Siqueira@....com>,
Wenjing Liu <wenjing.liu@....com>,
Bhawanpreet Lakha <Bhawanpreet.Lakha@....com>,
abdoulaye.berthe@....com, Hersen Wu <hersenxs.wu@....com>,
jinlong.zhang@....com, "Cyr, Aric" <aric.cyr@....com>,
amd-gfx list <amd-gfx@...ts.freedesktop.org>,
Maling list - DRI developers
<dri-devel@...ts.freedesktop.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/amd/display: should check error using DC_OK
On Mon, Aug 17, 2020 at 3:08 AM Tong Zhang <ztong0001@...il.com> wrote:
>
> 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 <ztong0001@...il.com>
Applied. Thanks!
Alex
> ---
> 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 5cb7b834e459..a60a457fcc8f 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
> @@ -4376,9 +4376,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 =
> @@ -4417,9 +4417,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
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Powered by blists - more mailing lists