linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-next] crypto: marvell/octeontx - use sysfs_emit() to instead of scnprintf()
@ 2022-09-23  1:29 cgel.zte
  2022-09-24  4:59 ` Kees Cook
  2022-09-30  6:16 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: cgel.zte @ 2022-09-23  1:29 UTC (permalink / raw)
  To: herbert
  Cc: bbrezillon, arno, schalla, davem, keescook, gustavoars,
	colin.i.king, linux-crypto, linux-kernel, ye xingchen

From: ye xingchen <ye.xingchen@zte.com.cn>

Replace the open-code with sysfs_emit() to simplify the code.

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
 drivers/crypto/marvell/octeontx/otx_cptvf_main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/marvell/octeontx/otx_cptvf_main.c b/drivers/crypto/marvell/octeontx/otx_cptvf_main.c
index 36d72e35ebeb..88a41d1ca5f6 100644
--- a/drivers/crypto/marvell/octeontx/otx_cptvf_main.c
+++ b/drivers/crypto/marvell/octeontx/otx_cptvf_main.c
@@ -661,7 +661,7 @@ static ssize_t vf_type_show(struct device *dev,
 		msg = "Invalid";
 	}
 
-	return scnprintf(buf, PAGE_SIZE, "%s\n", msg);
+	return sysfs_emit(buf, "%s\n", msg);
 }
 
 static ssize_t vf_engine_group_show(struct device *dev,
@@ -670,7 +670,7 @@ static ssize_t vf_engine_group_show(struct device *dev,
 {
 	struct otx_cptvf *cptvf = dev_get_drvdata(dev);
 
-	return scnprintf(buf, PAGE_SIZE, "%d\n", cptvf->vfgrp);
+	return sysfs_emit(buf, "%d\n", cptvf->vfgrp);
 }
 
 static ssize_t vf_engine_group_store(struct device *dev,
@@ -706,7 +706,7 @@ static ssize_t vf_coalesc_time_wait_show(struct device *dev,
 {
 	struct otx_cptvf *cptvf = dev_get_drvdata(dev);
 
-	return scnprintf(buf, PAGE_SIZE, "%d\n",
+	return sysfs_emit(buf, "%d\n",
 			 cptvf_read_vq_done_timewait(cptvf));
 }
 
@@ -716,7 +716,7 @@ static ssize_t vf_coalesc_num_wait_show(struct device *dev,
 {
 	struct otx_cptvf *cptvf = dev_get_drvdata(dev);
 
-	return scnprintf(buf, PAGE_SIZE, "%d\n",
+	return sysfs_emit(buf, "%d\n",
 			 cptvf_read_vq_done_numwait(cptvf));
 }
 
-- 
2.25.1

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

* Re: [PATCH linux-next] crypto: marvell/octeontx - use sysfs_emit() to instead of scnprintf()
  2022-09-23  1:29 [PATCH linux-next] crypto: marvell/octeontx - use sysfs_emit() to instead of scnprintf() cgel.zte
@ 2022-09-24  4:59 ` Kees Cook
  2022-09-30  6:16 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Kees Cook @ 2022-09-24  4:59 UTC (permalink / raw)
  To: cgel.zte
  Cc: herbert, bbrezillon, arno, schalla, davem, gustavoars,
	colin.i.king, linux-crypto, linux-kernel, ye xingchen

On Fri, Sep 23, 2022 at 01:29:52AM +0000, cgel.zte@gmail.com wrote:
> From: ye xingchen <ye.xingchen@zte.com.cn>
> 
> Replace the open-code with sysfs_emit() to simplify the code.
> 
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>

Thanks for the clean-up!

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

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

* Re: [PATCH linux-next] crypto: marvell/octeontx - use sysfs_emit() to instead of scnprintf()
  2022-09-23  1:29 [PATCH linux-next] crypto: marvell/octeontx - use sysfs_emit() to instead of scnprintf() cgel.zte
  2022-09-24  4:59 ` Kees Cook
@ 2022-09-30  6:16 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2022-09-30  6:16 UTC (permalink / raw)
  To: cgel.zte
  Cc: bbrezillon, arno, schalla, davem, keescook, gustavoars,
	colin.i.king, linux-crypto, linux-kernel, ye xingchen

On Fri, Sep 23, 2022 at 01:29:52AM +0000, cgel.zte@gmail.com wrote:
> From: ye xingchen <ye.xingchen@zte.com.cn>
> 
> Replace the open-code with sysfs_emit() to simplify the code.
> 
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
> ---
>  drivers/crypto/marvell/octeontx/otx_cptvf_main.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

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] 3+ messages in thread

end of thread, other threads:[~2022-09-30  6:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-23  1:29 [PATCH linux-next] crypto: marvell/octeontx - use sysfs_emit() to instead of scnprintf() cgel.zte
2022-09-24  4:59 ` Kees Cook
2022-09-30  6:16 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).