Hi Youssef,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.18-rc2 next-20251023]
[cannot apply to drm-misc/drm-misc-next drm-tip/drm-tip]
[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/Youssef-Samir/accel-qaic-Add-DMA-Bridge-Channel-DBC-sysfs-and-uevents/20251023-042723
base:   linus/master
patch link:    
https://lore.kernel.org/r/20251022202527.3873558-2-youssef.abdulrahman%40oss.qualcomm.com
patch subject: [PATCH 1/3] accel/qaic: Add DMA Bridge Channel(DBC) sysfs and 
uevents
config: openrisc-allyesconfig 
(https://download.01.org/0day-ci/archive/20251024/[email protected]/config)
compiler: or1k-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): 
(https://download.01.org/0day-ci/archive/20251024/[email protected]/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 <[email protected]>
| Closes: 
https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

   drivers/accel/qaic/qaic_sysfs.c: In function 'qaic_sysfs_init':
>> drivers/accel/qaic/qaic_sysfs.c:74:58: warning: '_state' directive output 
>> may be truncated writing 6 bytes into a region of size between 3 and 10 
>> [-Wformat-truncation=]
      74 |                 snprintf(dbc_attr->name, NAME_LEN, "dbc%d_state", i);
         |                                                          ^~~~~~
   drivers/accel/qaic/qaic_sysfs.c:74:17: note: 'snprintf' output between 11 
and 18 bytes into a destination of size 14
      74 |                 snprintf(dbc_attr->name, NAME_LEN, "dbc%d_state", i);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/_state +74 drivers/accel/qaic/qaic_sysfs.c

    56  
    57  int qaic_sysfs_init(struct qaic_drm_device *qddev)
    58  {
    59          struct device *kdev = to_accel_kdev(qddev);
    60          struct drm_device *drm = to_drm(qddev);
    61          u32 num_dbc = qddev->qdev->num_dbc;
    62          struct dbc_attribute *dbc_attrs;
    63          int i, ret;
    64  
    65          dbc_attrs = drmm_kcalloc(drm, num_dbc, sizeof(*dbc_attrs), 
GFP_KERNEL);
    66          if (!dbc_attrs)
    67                  return -ENOMEM;
    68  
    69          for (i = 0; i < num_dbc; ++i) {
    70                  struct dbc_attribute *dbc_attr = &dbc_attrs[i];
    71  
    72                  sysfs_attr_init(&dbc_attr->dev_attr.attr);
    73                  dbc_attr->dbc_id = i;
  > 74                  snprintf(dbc_attr->name, NAME_LEN, "dbc%d_state", i);
    75                  dbc_attr->dev_attr.attr.name = dbc_attr->name;
    76                  dbc_attr->dev_attr.attr.mode = 0444;
    77                  dbc_attr->dev_attr.show = dbc_state_show;
    78                  ret = sysfs_create_file(&kdev->kobj, 
&dbc_attr->dev_attr.attr);
    79                  if (ret) {
    80                          int j;
    81  
    82                          for (j = 0; j < i; ++j) {
    83                                  dbc_attr = &dbc_attrs[j];
    84                                  sysfs_remove_file(&kdev->kobj, 
&dbc_attr->dev_attr.attr);
    85                          }
    86                          drmm_kfree(drm, dbc_attrs);
    87                          return ret;
    88                  }
    89          }
    90  
    91          qddev->sysfs_attrs = dbc_attrs;
    92          return 0;
    93  }
    94  

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

Reply via email to