From: kernel test robot <lkp@intel.com>
To: Jack Xiao <Jack.Xiao@amd.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Alex Deucher <alexander.deucher@amd.com>
Subject: drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c:1443:66: warning: '%s' directive output may be truncated writing 1 byte into a region of size between 0 and 29
Date: Sat, 21 Oct 2023 03:36:05 +0800 [thread overview]
Message-ID: <202310210328.KaJWGR5u-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c3200081020d63f6c6bfd8a6db2ae8a5b99b348a
commit: 97998b893c3000b27a780a4982e16cfc8f4ea555 drm/amd/amdgpu: introduce gc_*_mes_2.bin v2
date: 6 months ago
config: x86_64-randconfig-x051-20230809 (https://download.01.org/0day-ci/archive/20231021/202310210328.KaJWGR5u-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231021/202310210328.KaJWGR5u-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/202310210328.KaJWGR5u-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c: In function 'amdgpu_mes_init_microcode':
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c:1448:66: warning: '%s' directive output may be truncated writing up to 1 bytes into a region of size between 0 and 29 [-Wformat-truncation=]
1448 | snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes%s.bin",
| ^~
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c:1448:17: note: 'snprintf' output between 16 and 46 bytes into a destination of size 40
1448 | snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes%s.bin",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1449 | ucode_prefix,
| ~~~~~~~~~~~~~
1450 | pipe == AMDGPU_MES_SCHED_PIPE ? "" : "1");
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c:1443:66: warning: '%s' directive output may be truncated writing 1 byte into a region of size between 0 and 29 [-Wformat-truncation=]
1443 | snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes%s.bin",
| ^~
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c:1443:17: note: 'snprintf' output between 17 and 46 bytes into a destination of size 40
1443 | snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes%s.bin",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1444 | ucode_prefix,
| ~~~~~~~~~~~~~
1445 | pipe == AMDGPU_MES_SCHED_PIPE ? "_2" : "1");
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c:1443:66: warning: '%s' directive output may be truncated writing 2 bytes into a region of size between 0 and 29 [-Wformat-truncation=]
1443 | snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes%s.bin",
| ^~
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c:1443:17: note: 'snprintf' output between 18 and 47 bytes into a destination of size 40
1443 | snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes%s.bin",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1444 | ucode_prefix,
| ~~~~~~~~~~~~~
1445 | pipe == AMDGPU_MES_SCHED_PIPE ? "_2" : "1");
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c:1455:62: warning: '_mes.bin' directive output may be truncated writing 8 bytes into a region of size between 4 and 33 [-Wformat-truncation=]
1455 | snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes.bin",
| ^~~~~~~~
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c:1455:17: note: 'snprintf' output between 16 and 45 bytes into a destination of size 40
1455 | snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes.bin",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1456 | ucode_prefix);
| ~~~~~~~~~~~~~
vim +1443 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
1430
1431 int amdgpu_mes_init_microcode(struct amdgpu_device *adev, int pipe)
1432 {
1433 const struct mes_firmware_header_v1_0 *mes_hdr;
1434 struct amdgpu_firmware_info *info;
1435 char ucode_prefix[30];
1436 char fw_name[40];
1437 bool need_retry = false;
1438 int r;
1439
1440 amdgpu_ucode_ip_version_decode(adev, GC_HWIP, ucode_prefix,
1441 sizeof(ucode_prefix));
1442 if (adev->ip_versions[GC_HWIP][0] >= IP_VERSION(11, 0, 0)) {
> 1443 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes%s.bin",
1444 ucode_prefix,
1445 pipe == AMDGPU_MES_SCHED_PIPE ? "_2" : "1");
1446 need_retry = true;
1447 } else {
> 1448 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes%s.bin",
1449 ucode_prefix,
1450 pipe == AMDGPU_MES_SCHED_PIPE ? "" : "1");
1451 }
1452
1453 r = amdgpu_ucode_request(adev, &adev->mes.fw[pipe], fw_name);
1454 if (r && need_retry && pipe == AMDGPU_MES_SCHED_PIPE) {
> 1455 snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_mes.bin",
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2023-10-20 19:36 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=202310210328.KaJWGR5u-lkp@intel.com \
--to=lkp@intel.com \
--cc=Jack.Xiao@amd.com \
--cc=alexander.deucher@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/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
all inboxes | Powered by JetHome®