Commit 16a54d4e authored by Yang Guang's avatar Yang Guang Committed by Helge Deller

fbcon: replace snprintf in show functions with sysfs_emit

Use sysfs_emit instead of scnprintf or sprintf.
Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarYang Guang <yang.guang5@zte.com.cn>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
Link: https://patchwork.freedesktop.org/patch/msgid/0cb7ca73d9cd7162988a22a24cd18bbcd3d8bb27.1638156341.git.yang.guang5@zte.com.cn
parent d8bb92e7
...@@ -3185,7 +3185,7 @@ static ssize_t show_rotate(struct device *device, ...@@ -3185,7 +3185,7 @@ static ssize_t show_rotate(struct device *device,
rotate = fbcon_get_rotate(info); rotate = fbcon_get_rotate(info);
err: err:
console_unlock(); console_unlock();
return snprintf(buf, PAGE_SIZE, "%d\n", rotate); return sysfs_emit(buf, "%d\n", rotate);
} }
static ssize_t show_cursor_blink(struct device *device, static ssize_t show_cursor_blink(struct device *device,
...@@ -3210,7 +3210,7 @@ static ssize_t show_cursor_blink(struct device *device, ...@@ -3210,7 +3210,7 @@ static ssize_t show_cursor_blink(struct device *device,
blink = delayed_work_pending(&ops->cursor_work); blink = delayed_work_pending(&ops->cursor_work);
err: err:
console_unlock(); console_unlock();
return snprintf(buf, PAGE_SIZE, "%d\n", blink); return sysfs_emit(buf, "%d\n", blink);
} }
static ssize_t store_cursor_blink(struct device *device, static ssize_t store_cursor_blink(struct device *device,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment