amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Don't take the address of skip_scdc_overwrite in dc_link_detect_helper
@ 2020-02-14  6:29 Nathan Chancellor
  2020-02-14 16:01 ` Liu, Zhan
  0 siblings, 1 reply; 3+ messages in thread
From: Nathan Chancellor @ 2020-02-14  6:29 UTC (permalink / raw)
  To: Harry Wentland, Leo Li, Alex Deucher, Christian König,
	David (ChunMing) Zhou
  Cc: clang-built-linux, Nathan Chancellor, dri-devel, amd-gfx, linux-kernel

Clang warns:

../drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c:980:36:
warning: address of 'sink->edid_caps.panel_patch.skip_scdc_overwrite'
will always evaluate to 'true' [-Wpointer-bool-conversion]
                if (&sink->edid_caps.panel_patch.skip_scdc_overwrite)
                ~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
1 warning generated.

This is probably not what was intended so remove the address of
operator, which matches how skip_scdc_overwrite is handled in the rest
of the driver.

While we're here, drop an extra newline after this if block.

Fixes: a760fc1bff03 ("drm/amd/display: add monitor patch to disable SCDC read/write")
Link: https://github.com/ClangBuiltLinux/linux/issues/879
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---

As an aside, I don't see skip_scdc_overwrite assigned a value anywhere,
is this working as intended?

 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index 24d99849be5e..a3bfa05c545e 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -977,10 +977,9 @@ static bool dc_link_detect_helper(struct dc_link *link,
 		if ((prev_sink != NULL) && ((edid_status == EDID_THE_SAME) || (edid_status == EDID_OK)))
 			same_edid = is_same_edid(&prev_sink->dc_edid, &sink->dc_edid);
 
-		if (&sink->edid_caps.panel_patch.skip_scdc_overwrite)
+		if (sink->edid_caps.panel_patch.skip_scdc_overwrite)
 			link->ctx->dc->debug.hdmi20_disable = true;
 
-
 		if (link->connector_signal == SIGNAL_TYPE_DISPLAY_PORT &&
 			sink_caps.transaction_type == DDC_TRANSACTION_TYPE_I2C_OVER_AUX) {
 			/*
-- 
2.25.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] drm/amd/display: Don't take the address of skip_scdc_overwrite in dc_link_detect_helper
  2020-02-14  6:29 [PATCH] drm/amd/display: Don't take the address of skip_scdc_overwrite in dc_link_detect_helper Nathan Chancellor
@ 2020-02-14 16:01 ` Liu, Zhan
  2020-02-14 18:29   ` Liu, Zhan
  0 siblings, 1 reply; 3+ messages in thread
From: Liu, Zhan @ 2020-02-14 16:01 UTC (permalink / raw)
  To: Nathan Chancellor, Wentland, Harry, Li, Sun peng (Leo),
	Deucher, Alexander, Koenig, Christian, Zhou, David(ChunMing)
  Cc: clang-built-linux, amd-gfx, dri-devel, linux-kernel



> -----Original Message-----
> From: dri-devel <dri-devel-bounces@lists.freedesktop.org> On Behalf Of
> Nathan Chancellor
> Sent: 2020/February/14, Friday 1:30 AM
> To: Wentland, Harry <Harry.Wentland@amd.com>; Li, Sun peng (Leo)
> <Sunpeng.Li@amd.com>; Deucher, Alexander
> <Alexander.Deucher@amd.com>; Koenig, Christian
> <Christian.Koenig@amd.com>; Zhou, David(ChunMing)
> <David1.Zhou@amd.com>
> Cc: clang-built-linux@googlegroups.com; Nathan Chancellor
> <natechancellor@gmail.com>; dri-devel@lists.freedesktop.org; amd-
> gfx@lists.freedesktop.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] drm/amd/display: Don't take the address of
> skip_scdc_overwrite in dc_link_detect_helper
> 
> Clang warns:
> 
> ../drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c:980:36:
> warning: address of 'sink->edid_caps.panel_patch.skip_scdc_overwrite'
> will always evaluate to 'true' [-Wpointer-bool-conversion]
>                 if (&sink->edid_caps.panel_patch.skip_scdc_overwrite)
>                 ~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
> 1 warning generated.
> 
> This is probably not what was intended so remove the address of operator,
> which matches how skip_scdc_overwrite is handled in the rest of the driver.
> 
> While we're here, drop an extra newline after this if block.
> 
> Fixes: a760fc1bff03 ("drm/amd/display: add monitor patch to disable SCDC
> read/write")
> Link:
> https://github.com/ClangBuiltLinux/linux/issues/879
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>

Thank you!
Reviewed-by: Zhan Liu <zhan.liu@amd.com>

> ---
> 
> As an aside, I don't see skip_scdc_overwrite assigned a value anywhere, is
> this working as intended?
> 
>  drivers/gpu/drm/amd/display/dc/core/dc_link.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> index 24d99849be5e..a3bfa05c545e 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> @@ -977,10 +977,9 @@ static bool dc_link_detect_helper(struct dc_link
> *link,
>  		if ((prev_sink != NULL) && ((edid_status == EDID_THE_SAME)
> || (edid_status == EDID_OK)))
>  			same_edid = is_same_edid(&prev_sink->dc_edid,
> &sink->dc_edid);
> 
> -		if (&sink->edid_caps.panel_patch.skip_scdc_overwrite)
> +		if (sink->edid_caps.panel_patch.skip_scdc_overwrite)
>  			link->ctx->dc->debug.hdmi20_disable = true;
> 
> -
>  		if (link->connector_signal == SIGNAL_TYPE_DISPLAY_PORT
> &&
>  			sink_caps.transaction_type ==
> DDC_TRANSACTION_TYPE_I2C_OVER_AUX) {
>  			/*
> --
> 2.25.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.
> freedesktop.org%2Fmailman%2Flistinfo%2Fdri-
> devel&amp;data=02%7C01%7Czhan.liu%40amd.com%7Cb0b05e8e1c944b85
> 0cc108d7b12508b4%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7
> C637172644928182374&amp;sdata=OfX%2BPBPCkFt8Elo12VfVBg6Ecnui7Vh
> hZwQFaKy5eyM%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] drm/amd/display: Don't take the address of skip_scdc_overwrite in dc_link_detect_helper
  2020-02-14 16:01 ` Liu, Zhan
@ 2020-02-14 18:29   ` Liu, Zhan
  0 siblings, 0 replies; 3+ messages in thread
From: Liu, Zhan @ 2020-02-14 18:29 UTC (permalink / raw)
  To: 'Nathan Chancellor', Wentland, Harry, Li, Sun peng (Leo),
	Deucher, Alexander, Koenig, Christian, Zhou, David(ChunMing)
  Cc: 'clang-built-linux@googlegroups.com',
	'amd-gfx@lists.freedesktop.org',
	'dri-devel@lists.freedesktop.org',
	'linux-kernel@vger.kernel.org'


> -----Original Message-----
> From: Liu, Zhan
> Sent: 2020/February/14, Friday 11:01 AM
> To: Nathan Chancellor <natechancellor@gmail.com>; Wentland, Harry
> <Harry.Wentland@amd.com>; Li, Sun peng (Leo) <Sunpeng.Li@amd.com>;
> Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian
> <Christian.Koenig@amd.com>; Zhou, David(ChunMing)
> <David1.Zhou@amd.com>
> Cc: clang-built-linux@googlegroups.com; dri-devel@lists.freedesktop.org;
> amd-gfx@lists.freedesktop.org; linux-kernel@vger.kernel.org
> Subject: RE: [PATCH] drm/amd/display: Don't take the address of
> skip_scdc_overwrite in dc_link_detect_helper
> 
> 
> 
> > -----Original Message-----
> > From: dri-devel <dri-devel-bounces@lists.freedesktop.org> On Behalf Of
> > Nathan Chancellor
> > Sent: 2020/February/14, Friday 1:30 AM
> > To: Wentland, Harry <Harry.Wentland@amd.com>; Li, Sun peng (Leo)
> > <Sunpeng.Li@amd.com>; Deucher, Alexander
> <Alexander.Deucher@amd.com>;
> > Koenig, Christian <Christian.Koenig@amd.com>; Zhou, David(ChunMing)
> > <David1.Zhou@amd.com>
> > Cc: clang-built-linux@googlegroups.com; Nathan Chancellor
> > <natechancellor@gmail.com>; dri-devel@lists.freedesktop.org; amd-
> > gfx@lists.freedesktop.org; linux-kernel@vger.kernel.org
> > Subject: [PATCH] drm/amd/display: Don't take the address of
> > skip_scdc_overwrite in dc_link_detect_helper
> >
> > Clang warns:
> >
> > ../drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c:980:36:
> > warning: address of 'sink->edid_caps.panel_patch.skip_scdc_overwrite'
> > will always evaluate to 'true' [-Wpointer-bool-conversion]
> >                 if (&sink->edid_caps.panel_patch.skip_scdc_overwrite)
> >                 ~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
> > 1 warning generated.
> >
> > This is probably not what was intended so remove the address of
> > operator, which matches how skip_scdc_overwrite is handled in the rest of
> the driver.
> >
> > While we're here, drop an extra newline after this if block.
> >
> > Fixes: a760fc1bff03 ("drm/amd/display: add monitor patch to disable
> > SCDC
> > read/write")
> > Link:
> > https://github.com/ClangBuiltLinux/linux/issues/879
> > Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> 
> Thank you!
> Reviewed-by: Zhan Liu <zhan.liu@amd.com>

Also applied, thanks!

Zhan

> 
> > ---
> >
> > As an aside, I don't see skip_scdc_overwrite assigned a value
> > anywhere, is this working as intended?
> >
> >  drivers/gpu/drm/amd/display/dc/core/dc_link.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> > b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> > index 24d99849be5e..a3bfa05c545e 100644
> > --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> > +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> > @@ -977,10 +977,9 @@ static bool dc_link_detect_helper(struct dc_link
> > *link,
> >  		if ((prev_sink != NULL) && ((edid_status == EDID_THE_SAME)
> > || (edid_status == EDID_OK)))
> >  			same_edid = is_same_edid(&prev_sink->dc_edid,
> &sink->dc_edid);
> >
> > -		if (&sink->edid_caps.panel_patch.skip_scdc_overwrite)
> > +		if (sink->edid_caps.panel_patch.skip_scdc_overwrite)
> >  			link->ctx->dc->debug.hdmi20_disable = true;
> >
> > -
> >  		if (link->connector_signal == SIGNAL_TYPE_DISPLAY_PORT
> &&
> >  			sink_caps.transaction_type ==
> > DDC_TRANSACTION_TYPE_I2C_OVER_AUX) {
> >  			/*
> > --
> > 2.25.0
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-14 18:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-14  6:29 [PATCH] drm/amd/display: Don't take the address of skip_scdc_overwrite in dc_link_detect_helper Nathan Chancellor
2020-02-14 16:01 ` Liu, Zhan
2020-02-14 18:29   ` Liu, Zhan

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).