All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 7871/8170] drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:379:52: error: '%s' directive output may be truncated writing up to 29 bytes into a region of size 23
@ 2024-04-24 15:54 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-04-24 15:54 UTC (permalink / raw)
  To: Le Ma
  Cc: oe-kbuild-all, Linux Memory Management List, Alex Deucher,
	Hawking Zhang, Lijo Lazar

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   5e4f84f18c4ee9b0ccdc19e39b7de41df21699dd
commit: e88a7abec8376eaf588df9f79f76c170acf0396a [7871/8170] drm/amdgpu: init microcode chip name from ip versions
config: microblaze-allmodconfig (https://download.01.org/0day-ci/archive/20240424/202404242344.MYSO5VxE-lkp@intel.com/config)
compiler: microblaze-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240424/202404242344.MYSO5VxE-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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202404242344.MYSO5VxE-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c: In function 'gfx_v9_4_3_early_init':
>> drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:379:52: error: '%s' directive output may be truncated writing up to 29 bytes into a region of size 23 [-Werror=format-truncation=]
     379 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_rlc.bin", chip_name);
         |                                                    ^~
   ......
     439 |         r = gfx_v9_4_3_init_rlc_microcode(adev, ucode_prefix);
         |                                                 ~~~~~~~~~~~~
   In function 'gfx_v9_4_3_init_rlc_microcode',
       inlined from 'gfx_v9_4_3_init_microcode' at drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:439:6,
       inlined from 'gfx_v9_4_3_early_init' at drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:2257:9:
   drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:379:9: note: 'snprintf' output between 16 and 45 bytes into a destination of size 30
     379 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_rlc.bin", chip_name);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c: In function 'gfx_v9_4_3_early_init':
   drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:413:52: error: '%s' directive output may be truncated writing up to 29 bytes into a region of size 23 [-Werror=format-truncation=]
     413 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec.bin", chip_name);
         |                                                    ^~
   ......
     443 |         r = gfx_v9_4_3_init_cp_compute_microcode(adev, ucode_prefix);
         |                                                        ~~~~~~~~~~~~
   In function 'gfx_v9_4_3_init_cp_compute_microcode',
       inlined from 'gfx_v9_4_3_init_microcode' at drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:443:6,
       inlined from 'gfx_v9_4_3_early_init' at drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:2257:9:
   drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:413:9: note: 'snprintf' output between 16 and 45 bytes into a destination of size 30
     413 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mec.bin", chip_name);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors


vim +379 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c

86301129698be5 Le Ma 2022-05-24  369  
86301129698be5 Le Ma 2022-05-24  370  static int gfx_v9_4_3_init_rlc_microcode(struct amdgpu_device *adev,
86301129698be5 Le Ma 2022-05-24  371  					  const char *chip_name)
86301129698be5 Le Ma 2022-05-24  372  {
86301129698be5 Le Ma 2022-05-24  373  	char fw_name[30];
86301129698be5 Le Ma 2022-05-24  374  	int err;
86301129698be5 Le Ma 2022-05-24  375  	const struct rlc_firmware_header_v2_0 *rlc_hdr;
86301129698be5 Le Ma 2022-05-24  376  	uint16_t version_major;
86301129698be5 Le Ma 2022-05-24  377  	uint16_t version_minor;
86301129698be5 Le Ma 2022-05-24  378  
86301129698be5 Le Ma 2022-05-24 @379  	snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_rlc.bin", chip_name);
86301129698be5 Le Ma 2022-05-24  380  
86301129698be5 Le Ma 2022-05-24  381  	err = amdgpu_ucode_request(adev, &adev->gfx.rlc_fw, fw_name);
86301129698be5 Le Ma 2022-05-24  382  	if (err)
86301129698be5 Le Ma 2022-05-24  383  		goto out;
86301129698be5 Le Ma 2022-05-24  384  	rlc_hdr = (const struct rlc_firmware_header_v2_0 *)adev->gfx.rlc_fw->data;
86301129698be5 Le Ma 2022-05-24  385  
86301129698be5 Le Ma 2022-05-24  386  	version_major = le16_to_cpu(rlc_hdr->header.header_version_major);
86301129698be5 Le Ma 2022-05-24  387  	version_minor = le16_to_cpu(rlc_hdr->header.header_version_minor);
86301129698be5 Le Ma 2022-05-24  388  	err = amdgpu_gfx_rlc_init_microcode(adev, version_major, version_minor);
86301129698be5 Le Ma 2022-05-24  389  out:
86301129698be5 Le Ma 2022-05-24  390  	if (err)
86301129698be5 Le Ma 2022-05-24  391  		amdgpu_ucode_release(&adev->gfx.rlc_fw);
86301129698be5 Le Ma 2022-05-24  392  
86301129698be5 Le Ma 2022-05-24  393  	return err;
86301129698be5 Le Ma 2022-05-24  394  }
86301129698be5 Le Ma 2022-05-24  395  

:::::: The code at line 379 was first introduced by commit
:::::: 86301129698be52f8398f92ea8564168f6bfcae1 drm/amdgpu: split gc v9_4_3 functionality from gc v9_0

:::::: TO: Le Ma <le.ma@amd.com>
:::::: CC: Alex Deucher <alexander.deucher@amd.com>

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-24 15:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-24 15:54 [linux-next:master 7871/8170] drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:379:52: error: '%s' directive output may be truncated writing up to 29 bytes into a region of size 23 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.