From nobody Sun May 24 18:43:53 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B948CA6B for ; Fri, 22 May 2026 09:19:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779441568; cv=none; b=WUh16jS5Td2rEtQqPwUBB9ZAAWhq3ax/3TzKC1UUcIKMjGAylGiuN0luBfBrPRRnN4htNrEBD7vTqpmO2iNcJjce0E3cjrjY0u3Cg1fzwcgfx7NEmn13LYTN+TT/pobvPMkpirQKW103VIrN9lANsDmykc7ThUdofiCdQBfrB3Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779441568; c=relaxed/simple; bh=/XB285f/tC3A9vYpMm6F/GwGrs2uyxixSA78hBfjplQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=hXysS/wj2RchlTKAj3k+2QRbozl0sryGn18PS8Dvv4yAEhjTyZxFwSYtxZ4IuYJ1vm8VkxQZV6QsbsLqEIdDN7VTzmStfv/5i4nbm72yByeGi9G+uGizAyNrSB61QdwFBPh0pbEnptL+OK8cCMjuXmu1N999RH9cWiYwl59rQ1E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 50f1333255bf11f1aa26b74ffac11d73-20260522 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:3907f5cb-10e1-4dc5-a463-e8fa8ff10195,IP:0,U RL:0,TC:0,Content:0,EDM:-25,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:e7bac3a,CLOUDID:dd5522b411114bdc0608001cf9a16299,BulkI D:nil,BulkQuantity:0,Recheck:0,SF:102|850|865|898,TC:nil,Content:0|15|16|5 0,EDM:2,IP:nil,URL:99|1,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI: 0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULS X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 50f1333255bf11f1aa26b74ffac11d73-20260522 X-User: jindongyang@kylinos.cn Received: from localhost.localdomain [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 1456995312; Fri, 22 May 2026 17:19:21 +0800 From: Dongyang Jin To: alexander.deucher@amd.com, christian.koenig@amd.com, airlied@gmail.com, simona@ffwll.ch, sathishkumar.sundararaju@amd.com, yinjie.yao@amd.com, michal.simek@amd.com Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Dongyang Jin , kernel test robot Subject: [PATCH] drm/amdgpu/jpeg: Fix format-truncation warning in jpeg_v2_5_sw_init() Date: Fri, 22 May 2026 17:19:10 +0800 Message-Id: <20260522091910.3276524-1-jindongyang@kylinos.cn> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" A false-positive compile warnings: drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c: In function 'jpeg_v2_5_sw_init': drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c:152:68: warning: '%d' directive outp= ut may be truncated writing between 1 and 11 bytes into a region of size 7 = [-Wformat-truncation=3D] 152 | snprintf(ring->name, sizeof(ring->name), "jpeg_dec_= %d", i); | = ^~ drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c:152:58: note: directive argument in = the range [-2147483643, 255] 152 | snprintf(ring->name, sizeof(ring->name), "jpeg_dec_= %d", i); | ^~~~~~~~~~= ~~~ drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c:152:17: note: 'snprintf' output betw= een 11 and 21 bytes into a destination of size 16 152 | snprintf(ring->name, sizeof(ring->name), "jpeg_dec_= %d", i); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~ Suppress it by replacing the type of variable i with uint8_t. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202605212104.SAIMqegX-lkp@int= el.com/ Signed-off-by: Dongyang Jin --- drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c b/drivers/gpu/drm/amd/a= mdgpu/jpeg_v2_5.c index 5208312e7017..a88a1e1d6423 100644 --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c @@ -104,7 +104,8 @@ static int jpeg_v2_5_early_init(struct amdgpu_ip_block = *ip_block) static int jpeg_v2_5_sw_init(struct amdgpu_ip_block *ip_block) { struct amdgpu_ring *ring; - int i, r; + uint8_t i; + int r; struct amdgpu_device *adev =3D ip_block->adev; =20 for (i =3D 0; i < adev->jpeg.num_jpeg_inst; ++i) { @@ -149,7 +150,7 @@ static int jpeg_v2_5_sw_init(struct amdgpu_ip_block *ip= _block) else ring->vm_hub =3D AMDGPU_MMHUB0(0); ring->doorbell_index =3D (adev->doorbell_index.vcn.vcn_ring0_1 << 1) + 1= + 8 * i; - snprintf(ring->name, sizeof(ring->name), "jpeg_dec_%d", i); + snprintf(ring->name, sizeof(ring->name), "jpeg_dec_%u", i); r =3D amdgpu_ring_init(adev, ring, 512, &adev->jpeg.inst[i].irq, 0, AMDGPU_RING_PRIO_DEFAULT, NULL); if (r) --=20 2.25.1