mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Le Ma <le.ma@amd.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Alex Deucher <alexander.deucher@amd.com>,
	Hawking Zhang <Hawking.Zhang@amd.com>
Subject: drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:326:40: warning: '%d' directive writing between 1 and 10 bytes into a region of size between 0 and 8
Date: Sat, 21 Oct 2023 07:40:59 +0800	[thread overview]
Message-ID: <202310210731.mugeov4Z-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f74e3ea3ba9cdef948999c29c1c9793ea26787b4
commit: def799c6596d078112095c24c25e162cb5102d90 drm/amdgpu: add multi-xcc support to amdgpu_gfx interfaces (v4)
date:   6 months ago
config: x86_64-randconfig-x051-20230809 (https://download.01.org/0day-ci/archive/20231021/202310210731.mugeov4Z-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/202310210731.mugeov4Z-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/202310210731.mugeov4Z-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c: In function 'amdgpu_gfx_mqd_sw_fini':
   drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:451:16: warning: variable 'j' set but not used [-Wunused-but-set-variable]
     451 |         int i, j;
         |                ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c: In function 'amdgpu_gfx_disable_kcq':
   drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:486:13: warning: variable 'j' set but not used [-Wunused-but-set-variable]
     486 |         int j;
         |             ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c: In function 'amdgpu_gfx_enable_kcq':
   drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:529:19: warning: variable 'j' set but not used [-Wunused-but-set-variable]
     529 |         int r, i, j;
         |                   ^
   drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c: In function 'amdgpu_gfx_kiq_init_ring':
>> drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:326:40: warning: '%d' directive writing between 1 and 10 bytes into a region of size between 0 and 8 [-Wformat-overflow=]
     326 |         sprintf(ring->name, "kiq_%d.%d.%d.%d", xcc_id, ring->me, ring->pipe, ring->queue);
         |                                        ^~
   drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:326:29: note: directive argument in the range [0, 2147483647]
     326 |         sprintf(ring->name, "kiq_%d.%d.%d.%d", xcc_id, ring->me, ring->pipe, ring->queue);
         |                             ^~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:326:9: note: 'sprintf' output between 12 and 41 bytes into a destination of size 16
     326 |         sprintf(ring->name, "kiq_%d.%d.%d.%d", xcc_id, ring->me, ring->pipe, ring->queue);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +326 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c

   303	
   304	int amdgpu_gfx_kiq_init_ring(struct amdgpu_device *adev,
   305				     struct amdgpu_ring *ring,
   306				     struct amdgpu_irq_src *irq, int xcc_id)
   307	{
   308		struct amdgpu_kiq *kiq = &adev->gfx.kiq[xcc_id];
   309		int r = 0;
   310	
   311		spin_lock_init(&kiq->ring_lock);
   312	
   313		ring->adev = NULL;
   314		ring->ring_obj = NULL;
   315		ring->use_doorbell = true;
   316		ring->doorbell_index = adev->doorbell_index.kiq;
   317		ring->xcc_id = xcc_id;
   318		ring->vm_hub = AMDGPU_GFXHUB_0;
   319	
   320		r = amdgpu_gfx_kiq_acquire(adev, ring, xcc_id);
   321		if (r)
   322			return r;
   323	
   324		ring->eop_gpu_addr = kiq->eop_gpu_addr;
   325		ring->no_scheduler = true;
 > 326		sprintf(ring->name, "kiq_%d.%d.%d.%d", xcc_id, ring->me, ring->pipe, ring->queue);
   327		r = amdgpu_ring_init(adev, ring, 1024, irq, AMDGPU_CP_KIQ_IRQ_DRIVER0,
   328				     AMDGPU_RING_PRIO_DEFAULT, NULL);
   329		if (r)
   330			dev_warn(adev->dev, "(%d) failed to init kiq ring\n", r);
   331	
   332		return r;
   333	}
   334	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2023-10-20 23:41 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=202310210731.mugeov4Z-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=le.ma@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®