linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 1323/3381] drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:4: error: format specifies type 'unsigned char' but the argument has type 'int'
@ 2024-06-04 22:23 kernel test robot
  2024-06-05  6:17 ` Nathan Chancellor
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2024-06-04 22:23 UTC (permalink / raw)
  To: Srinivasan Shanmugam
  Cc: llvm, oe-kbuild-all, Linux Memory Management List, Alex Deucher,
	Lijo Lazar

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   d97496ca23a2d4ee80b7302849404859d9058bcd
commit: 0ea55445554209913a72eab86b60f5788776c4d6 [1323/3381] drm/amdgpu: Fix snprintf usage in amdgpu_gfx_kiq_init_ring
config: arm64-randconfig-003-20240605 (https://download.01.org/0day-ci/archive/20240605/202406050622.SmOX6DL6-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240605/202406050622.SmOX6DL6-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/202406050622.SmOX6DL6-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:4: error: format specifies type 'unsigned char' but the argument has type 'int' [-Werror,-Wformat]
                    xcc_id, ring->me, ring->pipe, ring->queue);
                    ^~~~~~
>> drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:12: error: format specifies type 'unsigned char' but the argument has type 'u32' (aka 'unsigned int') [-Werror,-Wformat]
                    xcc_id, ring->me, ring->pipe, ring->queue);
                            ^~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:22: error: format specifies type 'unsigned char' but the argument has type 'u32' (aka 'unsigned int') [-Werror,-Wformat]
                    xcc_id, ring->me, ring->pipe, ring->queue);
                                      ^~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:34: error: format specifies type 'unsigned char' but the argument has type 'u32' (aka 'unsigned int') [-Werror,-Wformat]
                    xcc_id, ring->me, ring->pipe, ring->queue);
                                                  ^~~~~~~~~~~
   4 errors generated.


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

71c37505e7eaa0 Alex Deucher         2017-06-07  306  
4acd31e6c2b97c Ma Jun               2024-02-18  307  int amdgpu_gfx_kiq_init_ring(struct amdgpu_device *adev, int xcc_id)
71c37505e7eaa0 Alex Deucher         2017-06-07  308  {
def799c6596d07 Le Ma                2022-05-24  309  	struct amdgpu_kiq *kiq = &adev->gfx.kiq[xcc_id];
4acd31e6c2b97c Ma Jun               2024-02-18  310  	struct amdgpu_irq_src *irq = &kiq->irq;
4acd31e6c2b97c Ma Jun               2024-02-18  311  	struct amdgpu_ring *ring = &kiq->ring;
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;
0ea55445554209 Srinivasan Shanmugam 2024-05-21  332  	snprintf(ring->name, sizeof(ring->name), "kiq_%hhu.%hhu.%hhu.%hhu",
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 333 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-next:master 1323/3381] drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:4: error: format specifies type 'unsigned char' but the argument has type 'int'
  2024-06-04 22:23 [linux-next:master 1323/3381] drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:4: error: format specifies type 'unsigned char' but the argument has type 'int' kernel test robot
@ 2024-06-05  6:17 ` Nathan Chancellor
  2024-06-20 21:17   ` Nick Desaulniers
  0 siblings, 1 reply; 3+ messages in thread
From: Nathan Chancellor @ 2024-06-05  6:17 UTC (permalink / raw)
  To: kernel test robot
  Cc: Srinivasan Shanmugam, llvm, oe-kbuild-all,
	Linux Memory Management List, Alex Deucher, Lijo Lazar,
	Nick Desaulniers

On Wed, Jun 05, 2024 at 06:23:57AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   d97496ca23a2d4ee80b7302849404859d9058bcd
> commit: 0ea55445554209913a72eab86b60f5788776c4d6 [1323/3381] drm/amdgpu: Fix snprintf usage in amdgpu_gfx_kiq_init_ring
> config: arm64-randconfig-003-20240605 (https://download.01.org/0day-ci/archive/20240605/202406050622.SmOX6DL6-lkp@intel.com/config)
> compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240605/202406050622.SmOX6DL6-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/202406050622.SmOX6DL6-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
> >> drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:4: error: format specifies type 'unsigned char' but the argument has type 'int' [-Werror,-Wformat]
>                     xcc_id, ring->me, ring->pipe, ring->queue);
>                     ^~~~~~
> >> drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:12: error: format specifies type 'unsigned char' but the argument has type 'u32' (aka 'unsigned int') [-Werror,-Wformat]
>                     xcc_id, ring->me, ring->pipe, ring->queue);
>                             ^~~~~~~~
>    drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:22: error: format specifies type 'unsigned char' but the argument has type 'u32' (aka 'unsigned int') [-Werror,-Wformat]
>                     xcc_id, ring->me, ring->pipe, ring->queue);
>                                       ^~~~~~~~~~
>    drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:34: error: format specifies type 'unsigned char' but the argument has type 'u32' (aka 'unsigned int') [-Werror,-Wformat]
>                     xcc_id, ring->me, ring->pipe, ring->queue);
>                                                   ^~~~~~~~~~~
>    4 errors generated.

For what it's worth, I think that we take care not to enable -Wformat
with clang versions older than 16 because of this issue, see commit
b0839b281c42 ("Makefile.extrawarn: re-enable -Wformat for clang; take
2") for more information. However, now that I am looking at
scripts/Makefile.extrawarn, it appears that we only do that for a normal
build, not W=1? That seems like a potential oversight of that change but
I am a little fuzzy on the conversation around that and I am not sure
Nick is around to answer that...

Cheers,
Nathan


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [linux-next:master 1323/3381] drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:4: error: format specifies type 'unsigned char' but the argument has type 'int'
  2024-06-05  6:17 ` Nathan Chancellor
@ 2024-06-20 21:17   ` Nick Desaulniers
  0 siblings, 0 replies; 3+ messages in thread
From: Nick Desaulniers @ 2024-06-20 21:17 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: kernel test robot, Srinivasan Shanmugam, llvm, oe-kbuild-all,
	Linux Memory Management List, Alex Deucher, Lijo Lazar

On Tue, Jun 4, 2024 at 11:17 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> On Wed, Jun 05, 2024 at 06:23:57AM +0800, kernel test robot wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> > head:   d97496ca23a2d4ee80b7302849404859d9058bcd
> > commit: 0ea55445554209913a72eab86b60f5788776c4d6 [1323/3381] drm/amdgpu: Fix snprintf usage in amdgpu_gfx_kiq_init_ring
> > config: arm64-randconfig-003-20240605 (https://download.01.org/0day-ci/archive/20240605/202406050622.SmOX6DL6-lkp@intel.com/config)
> > compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240605/202406050622.SmOX6DL6-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/202406050622.SmOX6DL6-lkp@intel.com/
> >
> > All errors (new ones prefixed by >>):
> >
> > >> drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:4: error: format specifies type 'unsigned char' but the argument has type 'int' [-Werror,-Wformat]
> >                     xcc_id, ring->me, ring->pipe, ring->queue);
> >                     ^~~~~~
> > >> drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:12: error: format specifies type 'unsigned char' but the argument has type 'u32' (aka 'unsigned int') [-Werror,-Wformat]
> >                     xcc_id, ring->me, ring->pipe, ring->queue);
> >                             ^~~~~~~~
> >    drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:22: error: format specifies type 'unsigned char' but the argument has type 'u32' (aka 'unsigned int') [-Werror,-Wformat]
> >                     xcc_id, ring->me, ring->pipe, ring->queue);
> >                                       ^~~~~~~~~~
> >    drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:34: error: format specifies type 'unsigned char' but the argument has type 'u32' (aka 'unsigned int') [-Werror,-Wformat]
> >                     xcc_id, ring->me, ring->pipe, ring->queue);
> >                                                   ^~~~~~~~~~~
> >    4 errors generated.
>
> For what it's worth, I think that we take care not to enable -Wformat
> with clang versions older than 16 because of this issue, see commit
> b0839b281c42 ("Makefile.extrawarn: re-enable -Wformat for clang; take
> 2") for more information. However, now that I am looking at
> scripts/Makefile.extrawarn, it appears that we only do that for a normal
> build, not W=1? That seems like a potential oversight of that change but
> I am a little fuzzy on the conversation around that and I am not sure
> Nick is around to answer that...

Yeah, unless `-Wformat` was being set explicitly somewhere else when I
wrote b0839b281c42 and has since been removed (-Wformat is part of
-Wall), then it looks like my "old clang" workarounds is only for "not
W=1 builds."  That block just needs to be moved outside of the
corresponding ifneq's else block.

>
> Cheers,
> Nathan



-- 
Thanks,
~Nick Desaulniers


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-20 21:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-04 22:23 [linux-next:master 1323/3381] drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:333:4: error: format specifies type 'unsigned char' but the argument has type 'int' kernel test robot
2024-06-05  6:17 ` Nathan Chancellor
2024-06-20 21:17   ` Nick Desaulniers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox