diff options
author | Xuezhi Zhang <zhangxuezhi1@coolpad.com> | 2022-05-31 07:28:14 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-06-10 13:43:44 +0200 |
commit | ebaed53c00174abf2224c1ebbe0f315189dfd046 (patch) | |
tree | 5cc276234d9e4eb4b32d5a39194c45d5580b18a7 /drivers/tty/vt/vt.c | |
parent | 2e1f2d9a9bdbe12ee475c82a45ac46a278e8049a (diff) | |
download | lwn-ebaed53c00174abf2224c1ebbe0f315189dfd046.tar.gz lwn-ebaed53c00174abf2224c1ebbe0f315189dfd046.zip |
tty: vt: convert sysfs snprintf to sysfs_emit
Fix the following coccicheck warnings:
drivers/tty/vt/vt.c:3942:8-16:
WARNING: use scnprintf or sprintf
drivers/tty/vt/vt.c:3950:8-16:
WARNING: use scnprintf or sprintf
Signed-off-by: Xuezhi Zhang <zhangxuezhi1@coolpad.com>
Link: https://lore.kernel.org/r/20220531072814.34999-1-zhangxuezhi1@coolpad.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/vt/vt.c')
-rw-r--r-- | drivers/tty/vt/vt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 1ea1c11c42fd..c718b0d01e3d 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -3939,7 +3939,7 @@ static ssize_t show_bind(struct device *dev, struct device_attribute *attr, bind = con_is_bound(con->con); console_unlock(); - return snprintf(buf, PAGE_SIZE, "%i\n", bind); + return sysfs_emit(buf, "%i\n", bind); } static ssize_t show_name(struct device *dev, struct device_attribute *attr, @@ -3947,7 +3947,7 @@ static ssize_t show_name(struct device *dev, struct device_attribute *attr, { struct con_driver *con = dev_get_drvdata(dev); - return snprintf(buf, PAGE_SIZE, "%s %s\n", + return sysfs_emit(buf, "%s %s\n", (con->flag & CON_DRIVER_FLAG_MODULE) ? "(M)" : "(S)", con->desc); |