[drm-misc:drm-misc-next 2/2] drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:368:21: warning: variable 'old_payload' is uninitialized when used here

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
head:   5aa1dfcdf0a429e4941e2eef75b006a8c7a8ac49
commit: 5aa1dfcdf0a429e4941e2eef75b006a8c7a8ac49 [2/2] drm/mst: Refactor the flow for payload allocation/removement
config: arm64-randconfig-r034-20230909 (https://download.01.org/0day-ci/archive/20230909/202309091509.IBo0CGxg-lkp@xxxxxxxxx/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230909/202309091509.IBo0CGxg-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309091509.IBo0CGxg-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:368:21: warning: variable 'old_payload' is uninitialized when used here [-Wuninitialized]
     368 |                                                  new_payload, old_payload);
         |                                                               ^~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:344:61: note: initialize the variable 'old_payload' to silence this warning
     344 |         struct drm_dp_mst_atomic_payload *new_payload, *old_payload;
         |                                                                    ^
         |                                                                     = NULL
   1 warning generated.


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

   335	
   336	bool dm_helpers_dp_mst_send_payload_allocation(
   337			struct dc_context *ctx,
   338			const struct dc_stream_state *stream,
   339			bool enable)
   340	{
   341		struct amdgpu_dm_connector *aconnector;
   342		struct drm_dp_mst_topology_state *mst_state;
   343		struct drm_dp_mst_topology_mgr *mst_mgr;
   344		struct drm_dp_mst_atomic_payload *new_payload, *old_payload;
   345		enum mst_progress_status set_flag = MST_ALLOCATE_NEW_PAYLOAD;
   346		enum mst_progress_status clr_flag = MST_CLEAR_ALLOCATED_PAYLOAD;
   347		int ret = 0;
   348	
   349		aconnector = (struct amdgpu_dm_connector *)stream->dm_stream_context;
   350	
   351		if (!aconnector || !aconnector->mst_root)
   352			return false;
   353	
   354		mst_mgr = &aconnector->mst_root->mst_mgr;
   355		mst_state = to_drm_dp_mst_topology_state(mst_mgr->base.state);
   356	
   357		new_payload = drm_atomic_get_mst_payload_state(mst_state, aconnector->mst_output_port);
   358	
   359		if (!enable) {
   360			set_flag = MST_CLEAR_ALLOCATED_PAYLOAD;
   361			clr_flag = MST_ALLOCATE_NEW_PAYLOAD;
   362		}
   363	
   364		if (enable) {
   365			ret = drm_dp_add_payload_part2(mst_mgr, mst_state->base.state, new_payload);
   366		} else {
   367			dm_helpers_construct_old_payload(stream->link, mst_state->pbn_div,
 > 368							 new_payload, old_payload);
   369			drm_dp_remove_payload_part2(mst_mgr, mst_state, old_payload, new_payload);
   370		}
   371	
   372		if (ret) {
   373			amdgpu_dm_set_mst_status(&aconnector->mst_status,
   374				set_flag, false);
   375		} else {
   376			amdgpu_dm_set_mst_status(&aconnector->mst_status,
   377				set_flag, true);
   378			amdgpu_dm_set_mst_status(&aconnector->mst_status,
   379				clr_flag, false);
   380		}
   381	
   382		return true;
   383	}
   384	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux