All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hwrng: core - convert sysfs sprintf/snprintf family to sysfs_emit
@ 2021-03-16 12:34 Jay Fang
  2021-03-26  9:30 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Jay Fang @ 2021-03-16 12:34 UTC (permalink / raw
  To: herbert, linux-crypto; +Cc: tangzihao1, huangdaode

From: Zihao Tang <tangzihao1@hisilicon.com>

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>
---
 drivers/char/hw_random/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
index 8c1c47d..adb3c2b 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,
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] hwrng: core - convert sysfs sprintf/snprintf family to sysfs_emit
  2021-03-16 12:34 [PATCH] hwrng: core - convert sysfs sprintf/snprintf family to sysfs_emit Jay Fang
@ 2021-03-26  9:30 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2021-03-26  9:30 UTC (permalink / raw
  To: Jay Fang; +Cc: linux-crypto, tangzihao1, huangdaode

On Tue, Mar 16, 2021 at 08:34:12PM +0800, Jay Fang wrote:
> From: Zihao Tang <tangzihao1@hisilicon.com>
> 
> 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>
> ---
>  drivers/char/hw_random/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-26  9:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-16 12:34 [PATCH] hwrng: core - convert sysfs sprintf/snprintf family to sysfs_emit Jay Fang
2021-03-26  9:30 ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.