mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-28 08:45:51 +00:00
livepatch: Replace snprintf() with sysfs_emit()
Let's use sysfs_emit() instead of snprintf(). Suggested-by: Miroslav Benes <mbenes@suse.cz> Signed-off-by: Yafang Shao <laoar.shao@gmail.com> Reviewed-by: Petr Mladek <pmladek@suse.com> Acked-by: Miroslav Benes <mbenes@suse.cz> Link: https://lore.kernel.org/r/20240625151123.2750-4-laoar.shao@gmail.com Signed-off-by: Petr Mladek <pmladek@suse.com>
This commit is contained in:
parent
40f9caa7b1
commit
9205269280
@ -402,7 +402,7 @@ static ssize_t enabled_show(struct kobject *kobj,
|
||||
struct klp_patch *patch;
|
||||
|
||||
patch = container_of(kobj, struct klp_patch, kobj);
|
||||
return snprintf(buf, PAGE_SIZE-1, "%d\n", patch->enabled);
|
||||
return sysfs_emit(buf, "%d\n", patch->enabled);
|
||||
}
|
||||
|
||||
static ssize_t transition_show(struct kobject *kobj,
|
||||
@ -411,8 +411,7 @@ static ssize_t transition_show(struct kobject *kobj,
|
||||
struct klp_patch *patch;
|
||||
|
||||
patch = container_of(kobj, struct klp_patch, kobj);
|
||||
return snprintf(buf, PAGE_SIZE-1, "%d\n",
|
||||
patch == klp_transition_patch);
|
||||
return sysfs_emit(buf, "%d\n", patch == klp_transition_patch);
|
||||
}
|
||||
|
||||
static ssize_t force_store(struct kobject *kobj, struct kobj_attribute *attr,
|
||||
|
Loading…
Reference in New Issue
Block a user