summary refs log tree commit diff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorQing Wang <wangqing@vivo.com>2021-10-14 23:49:52 -0700
committerLee Jones <lee.jones@linaro.org>2021-11-05 14:40:27 +0000
commit6ae210f1b51f1ba18142108e3247d332e6775210 (patch)
tree238947cb8c7df77569068417ee9e4616e918b51c /drivers/mfd
parent37f127cf8112461cd9d8ec38551bc4af87cb27f5 (diff)
downloadlinux-6ae210f1b51f1ba18142108e3247d332e6775210.tar.gz
mfd: janz-cmoio: Replace snprintf in show functions with sysfs_emit
show() must not use snprintf() when formatting the value to be
returned to user space.

Fix the following coccicheck warning:
drivers/mfd/janz-cmodio.c:157: WARNING: use scnprintf or sprintf.

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Signed-off-by: Qing Wang <wangqing@vivo.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/1634280592-4722-1-git-send-email-wangqing@vivo.com
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/janz-cmodio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mfd/janz-cmodio.c b/drivers/mfd/janz-cmodio.c
index 70eba4ce496f..add3bc04185b 100644
--- a/drivers/mfd/janz-cmodio.c
+++ b/drivers/mfd/janz-cmodio.c
@@ -154,7 +154,7 @@ static ssize_t modulbus_number_show(struct device *dev,
 {
 	struct cmodio_device *priv = dev_get_drvdata(dev);
 
-	return snprintf(buf, PAGE_SIZE, "%x\n", priv->hex);
+	return sysfs_emit(buf, "%x\n", priv->hex);
 }
 
 static DEVICE_ATTR_RO(modulbus_number);