From: Dan Carpenter <error27@gmail.com>
To: wenjing.liu@amd.com
Cc: amd-gfx@lists.freedesktop.org
Subject: [bug report] drm/amd/display: move eDP panel control logic to link_edp_panel_control
Date: Thu, 26 Jan 2023 14:06:54 +0300 [thread overview]
Message-ID: <Y9JezlqdEleSQh23@kili> (raw)
Hello Wenjing Liu,
The patch 0078c924e733: "drm/amd/display: move eDP panel control
logic to link_edp_panel_control" from Dec 19, 2022, leads to the
following Smatch static checker warning:
drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_edp_panel_control.c:353
link_edp_receiver_ready_T9() warn: potential negative cast to bool 'result'
drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_edp_panel_control.c:388
link_edp_receiver_ready_T7() warn: potential negative cast to bool 'result'
drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_edp_panel_control.c
331 bool link_edp_receiver_ready_T9(struct dc_link *link)
This function returns DC_OK (1) on success or positive on error or -1
on unknown error. So casting it to bool means it always returns true.
332 {
333 unsigned int tries = 0;
334 unsigned char sinkstatus = 0;
335 unsigned char edpRev = 0;
336 enum dc_status result = DC_OK;
337
338 result = core_link_read_dpcd(link, DP_EDP_DPCD_REV, &edpRev, sizeof(edpRev));
339
340 /* start from eDP version 1.2, SINK_STAUS indicate the sink is ready.*/
341 if (result == DC_OK && edpRev >= DP_EDP_12) {
342 do {
343 sinkstatus = 1;
344 result = core_link_read_dpcd(link, DP_SINK_STATUS, &sinkstatus, sizeof(sinkstatus));
345 if (sinkstatus == 0)
346 break;
347 if (result != DC_OK)
348 break;
349 udelay(100); //MAx T9
350 } while (++tries < 50);
351 }
352
--> 353 return result;
354 }
regards,
dan carpenter
next reply other threads:[~2023-01-26 13:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-26 11:06 Dan Carpenter [this message]
2023-03-22 9:33 [bug report] drm/amd/display: move eDP panel control logic to link_edp_panel_control Dan Carpenter
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=Y9JezlqdEleSQh23@kili \
--to=error27@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=wenjing.liu@amd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.