Commit 91253022 authored by Zihao Tang's avatar Zihao Tang Committed by Herbert Xu

hwrng: core - convert sysfs sprintf/snprintf family to sysfs_emit

Fix the following coccicheck warning:

drivers/char/hw_random/core.c:399:8-16: WARNING: use scnprintf or sprintf.
Signed-off-by: default avatarZihao Tang <tangzihao1@hisilicon.com>
Signed-off-by: default avatarJay Fang <f.fangjian@huawei.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 884b93c5
......@@ -396,7 +396,7 @@ static ssize_t hwrng_attr_selected_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
return snprintf(buf, PAGE_SIZE, "%d\n", cur_rng_set_by_user);
return sysfs_emit(buf, "%d\n", cur_rng_set_by_user);
}
static DEVICE_ATTR(rng_current, S_IRUGO | S_IWUSR,
......
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