[PATCH linux-next] fsi:(fsi-master-gpio)Convert sysfs sprintf/snprintf family to sysfs_emit
CGEL
cgel.zte at gmail.com
Sat Aug 21 13:42:50 AEST 2021
From: jing yangyang <jing.yangyang at zte.com.cn>
Fix the following coccicheck warning:
./drivers/fsi/fsi-master-gpio.c:721:8-16:WARNING:use scnprintf or sprintf
Reported-by: Zeal Robot <zealci at zte.com.cn>
Signed-off-by: jing yangyang <jing.yangyang at zte.com.cn>
---
drivers/fsi/fsi-master-gpio.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/fsi/fsi-master-gpio.c b/drivers/fsi/fsi-master-gpio.c
index 7d5f29b..865acb3 100644
--- a/drivers/fsi/fsi-master-gpio.c
+++ b/drivers/fsi/fsi-master-gpio.c
@@ -718,8 +718,7 @@ static ssize_t external_mode_show(struct device *dev,
{
struct fsi_master_gpio *master = dev_get_drvdata(dev);
- return snprintf(buf, PAGE_SIZE - 1, "%u\n",
- master->external_mode ? 1 : 0);
+ return sysfs_emit(buf, "%u\n", master->external_mode ? 1 : 0);
}
static ssize_t external_mode_store(struct device *dev,
--
1.8.3.1
More information about the linux-fsi
mailing list