summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_sysfs.c
diff options
context:
space:
mode:
authorTian Tao <tiantao6@hisilicon.com>2021-03-22 02:19:38 +0100
committerTian Tao <tiantao6@hisilicon.com>2021-03-23 12:41:39 +0100
commit835bc48380820d16102feb23819d456765efb692 (patch)
tree2bd2d2ae09172d5e8d26058025a2c1d6b7e3df94 /drivers/gpu/drm/drm_sysfs.c
parentdrm/gud: Remove unneeded semicolon (diff)
downloadlinux-835bc48380820d16102feb23819d456765efb692.tar.xz
linux-835bc48380820d16102feb23819d456765efb692.zip
drm/sysfs: Convert sysfs sprintf/snprintf family to sysfs_emit
Fix the following coccicheck warning: drivers/gpu/drm/drm_sysfs.c:172:8-16: WARNING: use scnprintf or sprintf drivers/gpu/drm/drm_sysfs.c:185:8-16: WARNING: use scnprintf or sprintf drivers/gpu/drm/drm_sysfs.c:159:8-16: WARNING: use scnprintf or sprintf Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1616375978-12151-1-git-send-email-tiantao6@hisilicon.com
Diffstat (limited to 'drivers/gpu/drm/drm_sysfs.c')
-rw-r--r--drivers/gpu/drm/drm_sysfs.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index f0336c804639..968a9560b4aa 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -156,8 +156,8 @@ static ssize_t status_show(struct device *device,
status = READ_ONCE(connector->status);
- return snprintf(buf, PAGE_SIZE, "%s\n",
- drm_get_connector_status_name(status));
+ return sysfs_emit(buf, "%s\n",
+ drm_get_connector_status_name(status));
}
static ssize_t dpms_show(struct device *device,
@@ -169,8 +169,7 @@ static ssize_t dpms_show(struct device *device,
dpms = READ_ONCE(connector->dpms);
- return snprintf(buf, PAGE_SIZE, "%s\n",
- drm_get_dpms_name(dpms));
+ return sysfs_emit(buf, "%s\n", drm_get_dpms_name(dpms));
}
static ssize_t enabled_show(struct device *device,
@@ -182,7 +181,7 @@ static ssize_t enabled_show(struct device *device,
enabled = READ_ONCE(connector->encoder);
- return snprintf(buf, PAGE_SIZE, enabled ? "enabled\n" : "disabled\n");
+ return sysfs_emit(buf, enabled ? "enabled\n" : "disabled\n");
}
static ssize_t edid_show(struct file *filp, struct kobject *kobj,