drm/amdgpu: use sysfs_emit() to instead of scnprintf()
Subsystems (2)
PATCH 1/1 drm/amdgpu: use sysfs_emit() to instead of scnprintf()
From: ye xingchen <[email protected]>
Replace the open-code with sysfs_emit() to simplify the code.
Signed-off-by ye xingchen <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +1 -1
@@ -1267,7 +1267,7 @@ static ssize_t amdgpu_ras_sysfs_features_read(struct device *dev,struct amdgpu_ras *con = container_of(attr, struct amdgpu_ras, features_attr); -return scnprintf (buf,PAGE_SIZE ,"feature mask: 0x%x\n" , con->features); +return sysfs_emit (buf,"feature mask: 0x%x\n" , con->features); }static void amdgpu_ras_sysfs_remove_bad_page_node (struct amdgpu_device *adev)
Signature · 1 line
2.25.1
Reviewed-by Luben Tuikov <[email protected]>
Regards,
Luben
Quoted 22 lines · On 2022-11-30 21:24, [email protected] wrote:
From: ye xingchen <[email protected]>
Replace the open-code with
sysfs_emit()to simplify the code.Signed-off-by ye xingchen <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +1
-1@@ -1267,7 +1267,7 @@ static ssize_t amdgpu_ras_sysfs_features_read(struct device *dev,struct amdgpu_ras *con = container_of(attr, struct amdgpu_ras, features_attr); -return scnprintf (buf,PAGE_SIZE ,"feature mask: 0x%x\n" , con->features); +return sysfs_emit (buf,"feature mask: 0x%x\n" , con->features); }static void amdgpu_ras_sysfs_remove_bad_page_node (struct amdgpu_device *adev)