summaryrefslogtreecommitdiffstats
path: root/drivers/char/hw_random
diff options
context:
space:
mode:
authorZihao Tang <tangzihao1@hisilicon.com>2021-03-16 20:34:12 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2021-03-26 20:02:34 +1100
commit91253022821def2a986f6d14762cbacde625b73c (patch)
tree38a59c3c21924701f7297f67fa037d3421ca5bdd /drivers/char/hw_random
parent884b93c510250269fbf73d8333eb69f214c42c0b (diff)
downloadlinux-91253022821def2a986f6d14762cbacde625b73c.tar.bz2
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: Zihao Tang <tangzihao1@hisilicon.com> Signed-off-by: Jay Fang <f.fangjian@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/char/hw_random')
-rw-r--r--drivers/char/hw_random/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
index 8c1c47dd9f46..adb3c2bd7783 100644
--- a/drivers/char/hw_random/core.c
+++ b/drivers/char/hw_random/core.c
@@ -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,