projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9a9e8a7
)
drm/amdgpu: prefer snprintf over sprintf
author
Jani Nikula
<jani.nikula@intel.com>
Wed, 10 Jan 2024 17:39:13 +0000
(19:39 +0200)
committer
Jani Nikula
<jani.nikula@intel.com>
Wed, 31 Jan 2024 09:04:25 +0000
(11:04 +0200)
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
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index b9674c57c4365fb5ebdf9644fc4ac0a31b955da8..82b4b2019fca03bcc863037d5c5e7be784ed9580 100644
(file)
--- a/
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@
-329,7
+329,8
@@
int amdgpu_gfx_kiq_init_ring(struct amdgpu_device *adev,
ring->eop_gpu_addr = kiq->eop_gpu_addr;
ring->no_scheduler = true;
- sprintf(ring->name, "kiq_%d.%d.%d.%d", xcc_id, ring->me, ring->pipe, ring->queue);
+ snprintf(ring->name, sizeof(ring->name), "kiq_%d.%d.%d.%d",
+ xcc_id, ring->me, ring->pipe, ring->queue);
r = amdgpu_ring_init(adev, ring, 1024, irq, AMDGPU_CP_KIQ_IRQ_DRIVER0,
AMDGPU_RING_PRIO_DEFAULT, NULL);
if (r)