[PATCH 2/8] drm/fdinfo: Switch to idr_for_each() in drm_show_memory_stats()

kernel test robot lkp at intel.com
Wed May 28 20:10:25 UTC 2025


Hi Simona,

kernel test robot noticed the following build warnings:

[auto build test WARNING on next-20250527]
[also build test WARNING on linus/master v6.15]
[cannot apply to v6.15 v6.15-rc7 v6.15-rc6]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Simona-Vetter/drm-gem-Fix-race-in-drm_gem_handle_create_tail/20250528-171524
base:   next-20250527
patch link:    https://lore.kernel.org/r/20250528091307.1894940-3-simona.vetter%40ffwll.ch
patch subject: [PATCH 2/8] drm/fdinfo: Switch to idr_for_each() in drm_show_memory_stats()
config: riscv-randconfig-001-20250529 (https://download.01.org/0day-ci/archive/20250529/202505290334.GjoY9qsk-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250529/202505290334.GjoY9qsk-lkp@intel.com/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 at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505290334.GjoY9qsk-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/drm_file.c:916:3: warning: variable 'drm_data' is uninitialized when used here [-Wuninitialized]
     916 |                 drm_data->supported_status |= s;
         |                 ^~~~~~~~
   drivers/gpu/drm/drm_file.c:903:36: note: initialize the variable 'drm_data' to silence this warning
     903 |         struct drm_bo_print_data *drm_data;
         |                                           ^
         |                                            = NULL
   1 warning generated.


vim +/drm_data +916 drivers/gpu/drm/drm_file.c

   899	
   900	static int
   901	drm_bo_memory_stats(int id, void *ptr, void *data)
   902	{
   903		struct drm_bo_print_data *drm_data;
   904		struct drm_gem_object *obj = ptr;
   905		enum drm_gem_object_status s = 0;
   906		size_t add_size;
   907	
   908		if (!obj)
   909			return 0;
   910	
   911		add_size = (obj->funcs && obj->funcs->rss) ?
   912			obj->funcs->rss(obj) : obj->size;
   913	
   914		if (obj->funcs && obj->funcs->status) {
   915			s = obj->funcs->status(obj);
 > 916			drm_data->supported_status |= s;
   917		}
   918	
   919		if (drm_gem_object_is_shared_for_memory_stats(obj))
   920			drm_data->status.shared += obj->size;
   921		else
   922			drm_data->status.private += obj->size;
   923	
   924		if (s & DRM_GEM_OBJECT_RESIDENT) {
   925			drm_data->status.resident += add_size;
   926		} else {
   927			/* If already purged or not yet backed by pages, don't
   928			 * count it as purgeable:
   929			 */
   930			s &= ~DRM_GEM_OBJECT_PURGEABLE;
   931		}
   932	
   933		if (!dma_resv_test_signaled(obj->resv, dma_resv_usage_rw(true))) {
   934			drm_data->status.active += add_size;
   935			drm_data->supported_status |= DRM_GEM_OBJECT_ACTIVE;
   936	
   937			/* If still active, don't count as purgeable: */
   938			s &= ~DRM_GEM_OBJECT_PURGEABLE;
   939		}
   940	
   941		if (s & DRM_GEM_OBJECT_PURGEABLE)
   942			drm_data->status.purgeable += add_size;
   943	
   944		return 0;
   945	}
   946	

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


More information about the dri-devel mailing list