[drm-xe:drm-xe-next 1052/1053] drivers/gpu/drm/xe/xe_gt_freq.c:201:30: warning: variable 'err' is uninitialized when used here

kernel test robot lkp at intel.com
Sat Dec 9 18:47:19 UTC 2023


tree:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
head:   1fc141d1f445b8e5ab4ff14645b0482dd98460b9
commit: 5d57684e0f5e1b8bb2484f0140a9b3a2f132f8fe [1052/1053] drm/xe: Create a xe_gt_freq component for raw management and sysfs
config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20231210/202312100223.2IyYhSLJ-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231210/202312100223.2IyYhSLJ-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/202312100223.2IyYhSLJ-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/xe/xe_gt_freq.c:201:30: warning: variable 'err' is uninitialized when used here [-Wuninitialized]
                            kobject_name(gt->sysfs), err);
                                                     ^~~
   include/drm/drm_print.h:466:36: note: expanded from macro 'drm_warn'
           __drm_printk((drm), warn,, fmt, ##__VA_ARGS__)
                                             ^~~~~~~~~~~
   include/drm/drm_print.h:456:48: note: expanded from macro '__drm_printk'
           dev_##level##type((drm)->dev, "[drm] " fmt, ##__VA_ARGS__)
                                                         ^~~~~~~~~~~
   include/linux/dev_printk.h:146:70: note: expanded from macro 'dev_warn'
           dev_printk_index_wrap(_dev_warn, KERN_WARNING, dev, dev_fmt(fmt), ##__VA_ARGS__)
                                                                               ^~~~~~~~~~~
   include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap'
                   _p_func(dev, fmt, ##__VA_ARGS__);                       \
                                       ^~~~~~~~~~~
   drivers/gpu/drm/xe/xe_gt_freq.c:196:9: note: initialize the variable 'err' to silence this warning
           int err;
                  ^
                   = 0
   1 warning generated.


vim +/err +201 drivers/gpu/drm/xe/xe_gt_freq.c

   186	
   187	/**
   188	 * xe_gt_freq_init - Initialize Xe Freq component
   189	 * @gt: Xe GT object
   190	 *
   191	 * It needs to be initialized after GT Sysfs and GuC PC components are ready.
   192	 */
   193	void xe_gt_freq_init(struct xe_gt *gt)
   194	{
   195		struct xe_device *xe = gt_to_xe(gt);
   196		int err;
   197	
   198		gt->freq = kobject_create_and_add("freq0", gt->sysfs);
   199		if (!gt->freq) {
   200			drm_warn(&xe->drm, "failed to add freq0 directory to %s, err: %d\n",
 > 201				 kobject_name(gt->sysfs), err);

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


More information about the Intel-xe mailing list