[linux-next:master 679/6333] drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c:49:52: warning: '%s' directive output may be truncated writing up to 63 bytes into a region of size 57

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   29e400e3ea486bf942b214769fc9778098114113
commit: 9d4346bdbc6484a1814011315827c258509b483c [679/6333] drm/amdgpu: add VPE 6.1.0 support
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20230920/202309200028.aUVuM8os-lkp@xxxxxxxxx/config)
compiler: alpha-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230920/202309200028.aUVuM8os-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/202309200028.aUVuM8os-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c: In function 'amdgpu_vpe_init_microcode':
>> drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c:49:52: warning: '%s' directive output may be truncated writing up to 63 bytes into a region of size 57 [-Wformat-truncation=]
      49 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s.bin", fw_prefix);
         |                                                    ^~       ~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c:49:9: note: 'snprintf' output between 12 and 75 bytes into a destination of size 64
      49 |         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s.bin", fw_prefix);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +49 drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c

    39	
    40	int amdgpu_vpe_init_microcode(struct amdgpu_vpe *vpe)
    41	{
    42		struct amdgpu_device *adev = vpe->ring.adev;
    43		const struct vpe_firmware_header_v1_0 *vpe_hdr;
    44		char fw_name[VPE_FW_NAME_LEN];
    45		char fw_prefix[VPE_FW_NAME_LEN];
    46		int ret;
    47	
    48		amdgpu_ucode_ip_version_decode(adev, VPE_HWIP, fw_prefix, sizeof(fw_prefix));
  > 49		snprintf(fw_name, sizeof(fw_name), "amdgpu/%s.bin", fw_prefix);
    50	
    51		ret = amdgpu_ucode_request(adev, &adev->vpe.fw, fw_name);
    52		if (ret)
    53			goto out;
    54	
    55		vpe_hdr = (const struct vpe_firmware_header_v1_0 *)adev->vpe.fw->data;
    56		adev->vpe.fw_version = le32_to_cpu(vpe_hdr->header.ucode_version);
    57		adev->vpe.feature_version = le32_to_cpu(vpe_hdr->ucode_feature_version);
    58	
    59		return 0;
    60	out:
    61		dev_err(adev->dev, "fail to initialize vpe microcode\n");
    62		release_firmware(adev->vpe.fw);
    63		adev->vpe.fw = NULL;
    64		return ret;
    65	}
    66	

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux