* [PATCH] fsi: master-ast-cf: replace snprintf with sysfs_emit
@ 2022-01-26 23:57 davidcomponentone
0 siblings, 0 replies; only message in thread
From: davidcomponentone @ 2022-01-26 23:57 UTC (permalink / raw)
To: jk
Cc: davidcomponentone, joel, alistair, eajames, linux-fsi,
linux-kernel, Yang Guang, Zeal Robot
From: Yang Guang <yang.guang5@zte.com.cn>
coccinelle report:
./drivers/fsi/fsi-master-ast-cf.c:1086:8-16:
WARNING: use scnprintf or sprintf
Use sysfs_emit instead of scnprintf or sprintf makes more sense.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Yang Guang <yang.guang5@zte.com.cn>
Signed-off-by: David Yang <davidcomponentone@gmail.com>
---
drivers/fsi/fsi-master-ast-cf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/fsi/fsi-master-ast-cf.c b/drivers/fsi/fsi-master-ast-cf.c
index 24292acdbaf8..e33c1cfb44cd 100644
--- a/drivers/fsi/fsi-master-ast-cf.c
+++ b/drivers/fsi/fsi-master-ast-cf.c
@@ -1083,7 +1083,7 @@ static ssize_t external_mode_show(struct device *dev,
{
struct fsi_master_acf *master = dev_get_drvdata(dev);
- return snprintf(buf, PAGE_SIZE - 1, "%u\n",
+ return sysfs_emit(buf, "%u\n",
master->external_mode ? 1 : 0);
}
--
2.30.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-01-26 23:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26 23:57 [PATCH] fsi: master-ast-cf: replace snprintf with sysfs_emit davidcomponentone
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).