On Tue, Jun 4, 2024 at 11:17 PM Nathan Chancellor <nathan@xxxxxxxxxx> 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@xxxxxxxxx/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@xxxxxxxxx/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@xxxxxxxxx> > > | Closes: https://lore.kernel.org/oe-kbuild-all/202406050622.SmOX6DL6-lkp@xxxxxxxxx/ > > > > 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