gpu: drm: Replace scnprintf() with sysfs_emit_at()
Subsystems (2)
PATCH 1/1 gpu: drm: Replace scnprintf() with sysfs_emit_at()
Replace scnprintf() with sysfs_emit_at() in drivers/gpu/drm/drm_sysfs.c. Per kernel documentation, show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space.
Signed-off-by Brigham Campbell <[email protected]>
---
I tested this patch with a device that outputs one specific resolution, or "mode" and with a dummy device which has no output modes. I'd appreciate Tested-by tags from anyone who can confirm that multi-mode graphics adapters work as expected too.
drivers/gpu/drm/drm_sysfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/drm_sysfs.c +1 -2
@@ -283,8 +283,7 @@ static ssize_t modes_show(struct device *device,mutex_lock (&connector->dev->mode_config.mutex);list_for_each_entry (mode, &connector->modes, head) { - written +=scnprintf (buf + written,PAGE_SIZE - written,"%s\n" , - mode->name); + written +=sysfs_emit_at (buf, written,"%s\n" , mode->name); }mutex_unlock (&connector->dev->mode_config.mutex);
Signature · 1 line
2.50.0