* [PATCH] crypto: omap - Use sysfs_emit in sysfs show functions
@ 2026-01-09 12:36 Thorsten Blum
2026-01-31 2:48 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2026-01-09 12:36 UTC (permalink / raw)
To: Herbert Xu, David S. Miller; +Cc: Thorsten Blum, linux-crypto, linux-kernel
Replace sprintf() with sysfs_emit() in sysfs show functions.
sysfs_emit() is preferred to format sysfs output as it provides better
bounds checking. No functional changes.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
drivers/crypto/omap-aes.c | 3 ++-
drivers/crypto/omap-sham.c | 5 +++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c
index 3cc802622dd5..3eadaf7a64fa 100644
--- a/drivers/crypto/omap-aes.c
+++ b/drivers/crypto/omap-aes.c
@@ -32,6 +32,7 @@
#include <linux/pm_runtime.h>
#include <linux/scatterlist.h>
#include <linux/string.h>
+#include <linux/sysfs.h>
#include <linux/workqueue.h>
#include "omap-crypto.h"
@@ -1042,7 +1043,7 @@ static ssize_t queue_len_show(struct device *dev, struct device_attribute *attr,
{
struct omap_aes_dev *dd = dev_get_drvdata(dev);
- return sprintf(buf, "%d\n", dd->engine->queue.max_qlen);
+ return sysfs_emit(buf, "%d\n", dd->engine->queue.max_qlen);
}
static ssize_t queue_len_store(struct device *dev,
diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
index ff8aac02994a..1ffc240e016a 100644
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -37,6 +37,7 @@
#include <linux/scatterlist.h>
#include <linux/slab.h>
#include <linux/string.h>
+#include <linux/sysfs.h>
#include <linux/workqueue.h>
#define MD5_DIGEST_SIZE 16
@@ -1973,7 +1974,7 @@ static ssize_t fallback_show(struct device *dev, struct device_attribute *attr,
{
struct omap_sham_dev *dd = dev_get_drvdata(dev);
- return sprintf(buf, "%d\n", dd->fallback_sz);
+ return sysfs_emit(buf, "%d\n", dd->fallback_sz);
}
static ssize_t fallback_store(struct device *dev, struct device_attribute *attr,
@@ -2003,7 +2004,7 @@ static ssize_t queue_len_show(struct device *dev, struct device_attribute *attr,
{
struct omap_sham_dev *dd = dev_get_drvdata(dev);
- return sprintf(buf, "%d\n", dd->queue.max_qlen);
+ return sysfs_emit(buf, "%d\n", dd->queue.max_qlen);
}
static ssize_t queue_len_store(struct device *dev,
--
Thorsten Blum <thorsten.blum@linux.dev>
GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] crypto: omap - Use sysfs_emit in sysfs show functions
2026-01-09 12:36 [PATCH] crypto: omap - Use sysfs_emit in sysfs show functions Thorsten Blum
@ 2026-01-31 2:48 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2026-01-31 2:48 UTC (permalink / raw)
To: Thorsten Blum; +Cc: David S. Miller, linux-crypto, linux-kernel
On Fri, Jan 09, 2026 at 01:36:40PM +0100, Thorsten Blum wrote:
> Replace sprintf() with sysfs_emit() in sysfs show functions.
> sysfs_emit() is preferred to format sysfs output as it provides better
> bounds checking. No functional changes.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> drivers/crypto/omap-aes.c | 3 ++-
> drivers/crypto/omap-sham.c | 5 +++--
> 2 files changed, 5 insertions(+), 3 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] 2+ messages in thread
end of thread, other threads:[~2026-01-31 2:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-09 12:36 [PATCH] crypto: omap - Use sysfs_emit in sysfs show functions Thorsten Blum
2026-01-31 2:48 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox