From: kernel test robot <lkp@intel.com>
To: Saleemkhan Jamadar <saleemkhan.jamadar@amd.com>
Cc: oe-kbuild-all@lists.linux.dev,
Linux Memory Management List <linux-mm@kvack.org>,
Alex Deucher <alexander.deucher@amd.com>,
Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com>,
Leo Liu <leo.liu@amd.com>
Subject: [linux-next:master 13404/13571] drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c:105:73: warning: '.bin' directive output may be truncated writing 4 bytes into a region of size between 2 and 31
Date: Fri, 15 Mar 2024 10:54:35 +0800 [thread overview]
Message-ID: <202403151008.QYEoXojA-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 9bb9b28d0568991b1d63e66fe75afa5f97ad1156
commit: b041fcaa26186dcfc121bcb9db285d6c73fd74e3 [13404/13571] drm/amdgpu/vcn: enable vcn1 fw load for VCN 4_0_6
config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20240315/202403151008.QYEoXojA-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240315/202403151008.QYEoXojA-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/202403151008.QYEoXojA-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c: In function 'amdgpu_vcn_early_init':
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c:102:66: warning: 'snprintf' output may be truncated before the last format character [-Wformat-truncation=]
102 | snprintf(fw_name, sizeof(fw_name), "amdgpu/%s.bin", ucode_prefix);
| ^
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c:102:17: note: 'snprintf' output between 12 and 41 bytes into a destination of size 40
102 | snprintf(fw_name, sizeof(fw_name), "amdgpu/%s.bin", ucode_prefix);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c:105:73: warning: '.bin' directive output may be truncated writing 4 bytes into a region of size between 2 and 31 [-Wformat-truncation=]
105 | snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_%d.bin", ucode_prefix, i);
| ^~~~
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c:105:25: note: 'snprintf' output between 14 and 43 bytes into a destination of size 40
105 | snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_%d.bin", ucode_prefix, i);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +105 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
93
94 int amdgpu_vcn_early_init(struct amdgpu_device *adev)
95 {
96 char ucode_prefix[30];
97 char fw_name[40];
98 int r, i;
99
100 for (i = 0; i < adev->vcn.num_vcn_inst; i++) {
101 amdgpu_ucode_ip_version_decode(adev, UVD_HWIP, ucode_prefix, sizeof(ucode_prefix));
102 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s.bin", ucode_prefix);
103 if (amdgpu_ip_version(adev, UVD_HWIP, 0) == IP_VERSION(4, 0, 6) &&
104 i == 1) {
> 105 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_%d.bin", ucode_prefix, i);
106 }
107
108 r = amdgpu_ucode_request(adev, &adev->vcn.fw[i], fw_name);
109 if (r) {
110 amdgpu_ucode_release(&adev->vcn.fw[i]);
111 return r;
112 }
113 }
114 return r;
115 }
116
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-03-15 2:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202403151008.QYEoXojA-lkp@intel.com \
--to=lkp@intel.com \
--cc=Veerabadhran.Gopalakrishnan@amd.com \
--cc=alexander.deucher@amd.com \
--cc=leo.liu@amd.com \
--cc=linux-mm@kvack.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=saleemkhan.jamadar@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox