All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c:590:13: warning: '%s' directive argument is null
@ 2025-02-12 20:50 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-02-12 20:50 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: oe-kbuild-all, linux-kernel, Alex Deucher

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   09fbf3d502050282bf47ab3babe1d4ed54dd1fd8
commit: 020620424b27bababf7f53d00692ab919c357a3f drm/amd: Use a constant format string for amdgpu_ucode_request
date:   6 months ago
config: x86_64-buildonly-randconfig-001-20250213 (https://download.01.org/0day-ci/archive/20250213/202502130406.iWQ0eBug-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250213/202502130406.iWQ0eBug-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/202502130406.iWQ0eBug-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c: In function 'amdgpu_umsch_mm_init_microcode':
>> drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c:590:13: warning: '%s' directive argument is null [-Wformat-overflow=]
     590 |         r = amdgpu_ucode_request(adev, &adev->umsch_mm.fw, "%s", fw_name);
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +590 drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c

   573	
   574	int amdgpu_umsch_mm_init_microcode(struct amdgpu_umsch_mm *umsch)
   575	{
   576		const struct umsch_mm_firmware_header_v1_0 *umsch_mm_hdr;
   577		struct amdgpu_device *adev = umsch->ring.adev;
   578		const char *fw_name = NULL;
   579		int r;
   580	
   581		switch (amdgpu_ip_version(adev, VCN_HWIP, 0)) {
   582		case IP_VERSION(4, 0, 5):
   583		case IP_VERSION(4, 0, 6):
   584			fw_name = "amdgpu/umsch_mm_4_0_0.bin";
   585			break;
   586		default:
   587			break;
   588		}
   589	
 > 590		r = amdgpu_ucode_request(adev, &adev->umsch_mm.fw, "%s", fw_name);
   591		if (r) {
   592			release_firmware(adev->umsch_mm.fw);
   593			adev->umsch_mm.fw = NULL;
   594			return r;
   595		}
   596	
   597		umsch_mm_hdr = (const struct umsch_mm_firmware_header_v1_0 *)adev->umsch_mm.fw->data;
   598	
   599		adev->umsch_mm.ucode_size = le32_to_cpu(umsch_mm_hdr->umsch_mm_ucode_size_bytes);
   600		adev->umsch_mm.data_size = le32_to_cpu(umsch_mm_hdr->umsch_mm_ucode_data_size_bytes);
   601	
   602		adev->umsch_mm.irq_start_addr =
   603			le32_to_cpu(umsch_mm_hdr->umsch_mm_irq_start_addr_lo) |
   604			((uint64_t)(le32_to_cpu(umsch_mm_hdr->umsch_mm_irq_start_addr_hi)) << 32);
   605		adev->umsch_mm.uc_start_addr =
   606			le32_to_cpu(umsch_mm_hdr->umsch_mm_uc_start_addr_lo) |
   607			((uint64_t)(le32_to_cpu(umsch_mm_hdr->umsch_mm_uc_start_addr_hi)) << 32);
   608		adev->umsch_mm.data_start_addr =
   609			le32_to_cpu(umsch_mm_hdr->umsch_mm_data_start_addr_lo) |
   610			((uint64_t)(le32_to_cpu(umsch_mm_hdr->umsch_mm_data_start_addr_hi)) << 32);
   611	
   612		if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
   613			struct amdgpu_firmware_info *info;
   614	
   615			info = &adev->firmware.ucode[AMDGPU_UCODE_ID_UMSCH_MM_UCODE];
   616			info->ucode_id = AMDGPU_UCODE_ID_UMSCH_MM_UCODE;
   617			info->fw = adev->umsch_mm.fw;
   618			adev->firmware.fw_size +=
   619				ALIGN(le32_to_cpu(umsch_mm_hdr->umsch_mm_ucode_size_bytes), PAGE_SIZE);
   620	
   621			info = &adev->firmware.ucode[AMDGPU_UCODE_ID_UMSCH_MM_DATA];
   622			info->ucode_id = AMDGPU_UCODE_ID_UMSCH_MM_DATA;
   623			info->fw = adev->umsch_mm.fw;
   624			adev->firmware.fw_size +=
   625				ALIGN(le32_to_cpu(umsch_mm_hdr->umsch_mm_ucode_data_size_bytes), PAGE_SIZE);
   626		}
   627	
   628		return 0;
   629	}
   630	

-- 
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:[~2025-02-12 20:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-12 20:50 drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c:590:13: warning: '%s' directive argument is null 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.