Skip to content

Commit 6ae210f

Browse files
Qing WangLee Jones
authored andcommitted
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
1 parent 37f127c commit 6ae210f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/mfd/janz-cmodio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static ssize_t modulbus_number_show(struct device *dev,
154154
{
155155
struct cmodio_device *priv = dev_get_drvdata(dev);
156156

157-
return snprintf(buf, PAGE_SIZE, "%x\n", priv->hex);
157+
return sysfs_emit(buf, "%x\n", priv->hex);
158158
}
159159

160160
static DEVICE_ATTR_RO(modulbus_number);

0 commit comments

Comments
 (0)