[PATCH] treewide: Replace scnprintf with sysfs_emit in

Abhinav Ananthu posted 1 patch 3 months, 2 weeks ago
drivers/tee/optee/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] treewide: Replace scnprintf with sysfs_emit in
Posted by Abhinav Ananthu 3 months, 2 weeks ago
Use sysfs_emit() to format sysfs output instead of scnprintf() as recommended
by the kernel documentation.

Signed-off-by: Abhinav Ananthu <abhinav.ogl@gmail.com>
---
 drivers/tee/optee/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c
index c75fddc83576..ce44e3498d37 100644
--- a/drivers/tee/optee/core.c
+++ b/drivers/tee/optee/core.c
@@ -72,7 +72,7 @@ static ssize_t rpmb_routing_model_show(struct device *dev,
 	else
 		s = "user";
 
-	return scnprintf(buf, PAGE_SIZE, "%s\n", s);
+	return sysfs_emit(buf, "%s\n", s);
 }
 static DEVICE_ATTR_RO(rpmb_routing_model);
 
-- 
2.34.1
Re: [PATCH] treewide: Replace scnprintf with sysfs_emit in
Posted by Jens Wiklander 1 month, 3 weeks ago
Hi Abhinav,

On Sun, Jun 22, 2025 at 10:30 AM Abhinav Ananthu <abhinav.ogl@gmail.com> wrote:
>
> Use sysfs_emit() to format sysfs output instead of scnprintf() as recommended
> by the kernel documentation.
>
> Signed-off-by: Abhinav Ananthu <abhinav.ogl@gmail.com>
> ---
>  drivers/tee/optee/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Your patch looks good, but I've already accepted another patch for the
same issue.

Thanks,
Jens