From: kernel test robot <lkp@intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: oe-kbuild-all@lists.linux.dev, dri-devel@lists.freedesktop.org,
Hamza Mahfooz <hamza.mahfooz@amd.com>,
Javier Martinez Canillas <javierm@redhat.com>
Subject: [drm-misc:drm-misc-next 2/2] drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:332:61: error: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size between 0 and 8
Date: Thu, 7 Mar 2024 09:32:18 +0800 [thread overview]
Message-ID: <202403070922.OGdsI4vn-lkp@intel.com> (raw)
tree: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
head: f89632a9e5fa6c4787c14458cd42a9ef42025434
commit: f89632a9e5fa6c4787c14458cd42a9ef42025434 [2/2] drm: Add CONFIG_DRM_WERROR
config: sparc-allmodconfig (https://download.01.org/0day-ci/archive/20240307/202403070922.OGdsI4vn-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240307/202403070922.OGdsI4vn-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/202403070922.OGdsI4vn-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c: In function 'amdgpu_gfx_kiq_init_ring':
>> drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:332:61: error: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size between 0 and 8 [-Werror=format-truncation=]
332 | snprintf(ring->name, sizeof(ring->name), "kiq_%d.%d.%d.%d",
| ^~
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:332:50: note: directive argument in the range [0, 2147483647]
332 | snprintf(ring->name, sizeof(ring->name), "kiq_%d.%d.%d.%d",
| ^~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:332:9: note: 'snprintf' output between 12 and 41 bytes into a destination of size 16
332 | snprintf(ring->name, sizeof(ring->name), "kiq_%d.%d.%d.%d",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
333 | xcc_id, ring->me, ring->pipe, ring->queue);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +332 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
71c37505e7eaa0 Alex Deucher 2017-06-07 306
71c37505e7eaa0 Alex Deucher 2017-06-07 307 int amdgpu_gfx_kiq_init_ring(struct amdgpu_device *adev,
71c37505e7eaa0 Alex Deucher 2017-06-07 308 struct amdgpu_ring *ring,
def799c6596d07 Le Ma 2022-05-24 309 struct amdgpu_irq_src *irq, int xcc_id)
71c37505e7eaa0 Alex Deucher 2017-06-07 310 {
def799c6596d07 Le Ma 2022-05-24 311 struct amdgpu_kiq *kiq = &adev->gfx.kiq[xcc_id];
71c37505e7eaa0 Alex Deucher 2017-06-07 312 int r = 0;
71c37505e7eaa0 Alex Deucher 2017-06-07 313
43ca8efa46d9b1 pding 2017-10-13 314 spin_lock_init(&kiq->ring_lock);
71c37505e7eaa0 Alex Deucher 2017-06-07 315
71c37505e7eaa0 Alex Deucher 2017-06-07 316 ring->adev = NULL;
71c37505e7eaa0 Alex Deucher 2017-06-07 317 ring->ring_obj = NULL;
71c37505e7eaa0 Alex Deucher 2017-06-07 318 ring->use_doorbell = true;
def799c6596d07 Le Ma 2022-05-24 319 ring->xcc_id = xcc_id;
3566938b3491bb Le Ma 2021-12-20 320 ring->vm_hub = AMDGPU_GFXHUB(xcc_id);
233bb3733bd439 Lijo Lazar 2023-01-19 321 ring->doorbell_index =
233bb3733bd439 Lijo Lazar 2023-01-19 322 (adev->doorbell_index.kiq +
233bb3733bd439 Lijo Lazar 2023-01-19 323 xcc_id * adev->doorbell_index.xcc_doorbell_range)
233bb3733bd439 Lijo Lazar 2023-01-19 324 << 1;
71c37505e7eaa0 Alex Deucher 2017-06-07 325
def799c6596d07 Le Ma 2022-05-24 326 r = amdgpu_gfx_kiq_acquire(adev, ring, xcc_id);
71c37505e7eaa0 Alex Deucher 2017-06-07 327 if (r)
71c37505e7eaa0 Alex Deucher 2017-06-07 328 return r;
71c37505e7eaa0 Alex Deucher 2017-06-07 329
71c37505e7eaa0 Alex Deucher 2017-06-07 330 ring->eop_gpu_addr = kiq->eop_gpu_addr;
a783910d5c8b45 Alex Deucher 2020-04-09 331 ring->no_scheduler = true;
345a36c4f1baa0 Jani Nikula 2024-01-10 @332 snprintf(ring->name, sizeof(ring->name), "kiq_%d.%d.%d.%d",
345a36c4f1baa0 Jani Nikula 2024-01-10 333 xcc_id, ring->me, ring->pipe, ring->queue);
c107171b8d3241 Christian König 2021-02-02 334 r = amdgpu_ring_init(adev, ring, 1024, irq, AMDGPU_CP_KIQ_IRQ_DRIVER0,
c107171b8d3241 Christian König 2021-02-02 335 AMDGPU_RING_PRIO_DEFAULT, NULL);
71c37505e7eaa0 Alex Deucher 2017-06-07 336 if (r)
71c37505e7eaa0 Alex Deucher 2017-06-07 337 dev_warn(adev->dev, "(%d) failed to init kiq ring\n", r);
71c37505e7eaa0 Alex Deucher 2017-06-07 338
71c37505e7eaa0 Alex Deucher 2017-06-07 339 return r;
71c37505e7eaa0 Alex Deucher 2017-06-07 340 }
71c37505e7eaa0 Alex Deucher 2017-06-07 341
:::::: The code at line 332 was first introduced by commit
:::::: 345a36c4f1baa03275d88cd13747c6c1748b1fc0 drm/amdgpu: prefer snprintf over sprintf
:::::: TO: Jani Nikula <jani.nikula@intel.com>
:::::: CC: Jani Nikula <jani.nikula@intel.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-03-07 1: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=202403070922.OGdsI4vn-lkp@intel.com \
--to=lkp@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hamza.mahfooz@amd.com \
--cc=jani.nikula@intel.com \
--cc=javierm@redhat.com \
--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.