[radeon-alex:amd-staging-drm-next 82/132] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:501:52: sparse: missing braces around initializer

kbuild test robot lkp at intel.com
Sat Jun 16 03:38:36 UTC 2018


tree:   git://people.freedesktop.org/~agd5f/linux.git amd-staging-drm-next
head:   486e4f30e2a3b7bdd2caa48d09b905a34f2f99cb
commit: 6e0ef9d85b99baeeea4b9c4a9777809cb0c6040a [82/132] drm/amd/display: Write TEST_EDID_CHECKSUM_WRITE for EDID tests
reproduce:
        # apt-get install sparse
        git checkout 6e0ef9d85b99baeeea4b9c4a9777809cb0c6040a
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

>> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:501:52: sparse: missing braces around initializer
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:502:54: sparse: missing braces around initializer

vim +501 drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c

   456	
   457	enum dc_edid_status dm_helpers_read_local_edid(
   458			struct dc_context *ctx,
   459			struct dc_link *link,
   460			struct dc_sink *sink)
   461	{
   462		struct amdgpu_dm_connector *aconnector = link->priv;
   463		struct i2c_adapter *ddc;
   464		int retry = 3;
   465		enum dc_edid_status edid_status;
   466		struct edid *edid;
   467	
   468		if (link->aux_mode)
   469			ddc = &aconnector->dm_dp_aux.aux.ddc;
   470		else
   471			ddc = &aconnector->i2c->base;
   472	
   473		/* some dongles read edid incorrectly the first time,
   474		 * do check sum and retry to make sure read correct edid.
   475		 */
   476		do {
   477	
   478			edid = drm_get_edid(&aconnector->base, ddc);
   479	
   480			if (!edid)
   481				return EDID_NO_RESPONSE;
   482	
   483			sink->dc_edid.length = EDID_LENGTH * (edid->extensions + 1);
   484			memmove(sink->dc_edid.raw_edid, (uint8_t *)edid, sink->dc_edid.length);
   485	
   486			/* We don't need the original edid anymore */
   487			kfree(edid);
   488	
   489			edid_status = dm_helpers_parse_edid_caps(
   490							ctx,
   491							&sink->dc_edid,
   492							&sink->edid_caps);
   493	
   494		} while (edid_status == EDID_BAD_CHECKSUM && --retry > 0);
   495	
   496		if (edid_status != EDID_OK)
   497			DRM_ERROR("EDID err: %d, on connector: %s",
   498					edid_status,
   499					aconnector->base.name);
   500		if (link->aux_mode) {
 > 501			union test_request test_request = {0};
   502			union test_response test_response = {0};
   503	
   504			dm_helpers_dp_read_dpcd(ctx,
   505						link,
   506						DP_TEST_REQUEST,
   507						&test_request.raw,
   508						sizeof(union test_request));
   509	
   510			if (!test_request.bits.EDID_READ)
   511				return edid_status;
   512	
   513			test_response.bits.EDID_CHECKSUM_WRITE = 1;
   514	
   515			dm_helpers_dp_write_dpcd(ctx,
   516						link,
   517						DP_TEST_EDID_CHECKSUM,
   518						&sink->dc_edid.raw_edid[sink->dc_edid.length-1],
   519						1);
   520	
   521			dm_helpers_dp_write_dpcd(ctx,
   522						link,
   523						DP_TEST_RESPONSE,
   524						&test_response.raw,
   525						sizeof(test_response));
   526	
   527		}
   528	
   529		return edid_status;
   530	}
   531	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation


More information about the dri-devel mailing list