From: kernel test robot <lkp@intel.com>
To: Le Ma <le.ma@amd.com>
Cc: oe-kbuild-all@lists.linux.dev,
Linux Memory Management List <linux-mm@kvack.org>,
Alex Deucher <alexander.deucher@amd.com>,
Hawking Zhang <Hawking.Zhang@amd.com>,
Lijo Lazar <lijo.lazar@amd.com>
Subject: [linux-next:master 7871/8170] drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:379:52: warning: '%s' directive output may be truncated writing up to 29 bytes into a region of size 23
Date: Wed, 24 Apr 2024 23:32:09 +0800 [thread overview]
Message-ID: <202404242330.Fb2cmamD-lkp@intel.com> (raw)
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: x86_64-buildonly-randconfig-003-20240424 (https://download.01.org/0day-ci/archive/20240424/202404242330.Fb2cmamD-lkp@intel.com/config)
compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240424/202404242330.Fb2cmamD-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/202404242330.Fb2cmamD-lkp@intel.com/
All warnings (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: warning: '%s' directive output may be truncated writing up to 29 bytes into a region of size 23 [-Wformat-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: warning: '%s' directive output may be truncated writing up to 29 bytes into a region of size 23 [-Wformat-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);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
reply other threads:[~2024-04-24 15:32 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=202404242330.Fb2cmamD-lkp@intel.com \
--to=lkp@intel.com \
--cc=Hawking.Zhang@amd.com \
--cc=alexander.deucher@amd.com \
--cc=le.ma@amd.com \
--cc=lijo.lazar@amd.com \
--cc=linux-mm@kvack.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 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.