Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: prefer snprintf over sprintf

This will trade the W=1 warning -Wformat-overflow to
-Wformat-truncation. This lets us enable -Wformat-overflow subsystem
wide.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Pan, Xinhui <Xinhui.Pan@amd.com>
Cc: amd-gfx@lists.freedesktop.org
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/fea7a52924f98b1ac24f4a7e6ba21d7754422430.1704908087.git.jani.nikula@intel.com

+2 -1
+2 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
··· 329 329 330 330 ring->eop_gpu_addr = kiq->eop_gpu_addr; 331 331 ring->no_scheduler = true; 332 - sprintf(ring->name, "kiq_%d.%d.%d.%d", xcc_id, ring->me, ring->pipe, ring->queue); 332 + snprintf(ring->name, sizeof(ring->name), "kiq_%d.%d.%d.%d", 333 + xcc_id, ring->me, ring->pipe, ring->queue); 333 334 r = amdgpu_ring_init(adev, ring, 1024, irq, AMDGPU_CP_KIQ_IRQ_DRIVER0, 334 335 AMDGPU_RING_PRIO_DEFAULT, NULL); 335 336 if (r)