]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/amdgpu: switch XGMI sysfs show helpers to sysfs_emit_at()
authorDavid Baum <davidbaum461@gmail.com>
Fri, 13 Mar 2026 01:52:26 +0000 (20:52 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 17 Mar 2026 14:38:59 +0000 (10:38 -0400)
commitc955e99a060e4dc94228abe5cf63edd1e09754f2
tree3275f0856b678783d0adc827ef2d796a06782a9c
parenteb422f3bbdff4ef870b855b7252e60bb591ed85f
drm/amdgpu: switch XGMI sysfs show helpers to sysfs_emit_at()

The XGMI sysfs show helpers amdgpu_xgmi_show_num_hops() and
amdgpu_xgmi_show_num_links() currently populate the output buffer with
sprintf() and then call sysfs_emit(buf, "%s\n", buf) to append the final
newline.

Convert both helpers to use sysfs_emit_at() while tracking the current
offset. This keeps buffer construction in the sysfs helpers, avoids
feeding the output buffer back into the final formatted write, and
matches the style already used by
amdgpu_xgmi_show_connected_port_num().

Signed-off-by: David Baum <davidbaum461@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c