drm/amd/display: Don't take the address of skip_scdc_overwrite in dc_link_detect_helper
authorNathan Chancellor <natechancellor@gmail.com>
Fri, 14 Feb 2020 18:24:39 +0000 (13:24 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 19 Feb 2020 15:36:26 +0000 (10:36 -0500)
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>
Signed-off-by: Zhan Liu <zhan.liu@amd.com>
Reviewed-by: Zhan Liu <zhan.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link.c

index 24d99849be5e1d292058b6d1c6869cf50622d85c..a3bfa05c545e2fe02038559e1c0cf06d10f035c5 100644 (file)
@@ -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) {
                        /*