From: Alex Deucher <alexdeucher@gmail.com>
To: Tong Zhang <ztong0001@gmail.com>
Cc: "Wentland, Harry" <harry.wentland@amd.com>,
"Leo (Sunpeng) Li" <sunpeng.li@amd.com>,
"Deucher, Alexander" <alexander.deucher@amd.com>,
Christian Koenig <christian.koenig@amd.com>,
Dave Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
"Siqueira, Rodrigo" <Rodrigo.Siqueira@amd.com>,
Wenjing Liu <wenjing.liu@amd.com>,
Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
abdoulaye.berthe@amd.com, Hersen Wu <hersenxs.wu@amd.com>,
jinlong.zhang@amd.com, "Cyr, Aric" <aric.cyr@amd.com>,
amd-gfx list <amd-gfx@lists.freedesktop.org>,
Maling list - DRI developers <dri-devel@lists.freedesktop.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/amd/display: should check error using DC_OK
Date: Tue, 18 Aug 2020 10:56:10 -0400 [thread overview]
Message-ID: <CADnq5_NDMZp9-1vVZ_CuxPJmxF8c1ULNbVmuMD6V9C3QT=OsmQ@mail.gmail.com> (raw)
In-Reply-To: <20200816073214.980424-1-ztong0001@gmail.com>
On Mon, Aug 17, 2020 at 3:08 AM Tong Zhang <ztong0001@gmail.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@gmail.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@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2020-08-18 14:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-16 7:32 [PATCH] drm/amd/display: should check error using DC_OK Tong Zhang
2020-08-18 14:56 ` Alex Deucher [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CADnq5_NDMZp9-1vVZ_CuxPJmxF8c1ULNbVmuMD6V9C3QT=OsmQ@mail.gmail.com' \
--to=alexdeucher@gmail.com \
--cc=Bhawanpreet.Lakha@amd.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=abdoulaye.berthe@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=aric.cyr@amd.com \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=hersenxs.wu@amd.com \
--cc=jinlong.zhang@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sunpeng.li@amd.com \
--cc=wenjing.liu@amd.com \
--cc=ztong0001@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).