diff mbox series

fsi: master-ast-cf: replace snprintf with sysfs_emit

Message ID 07ad7a3621b9f92e291710ec58225a5e4580a46e.1643183118.git.yang.guang5@zte.com.cn
State New
Headers show
Series fsi: master-ast-cf: replace snprintf with sysfs_emit | expand

Commit Message

Yang Guang Jan. 26, 2022, 11:57 p.m. UTC
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 mbox series

Patch

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);
 }