aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/chp.c
diff options
context:
space:
mode:
authorQing Wang <wangqing@vivo.com>2021-10-14 23:50:54 -0700
committerHeiko Carstens <hca@linux.ibm.com>2021-11-16 12:29:19 +0100
commit4b9e04367afe214e06736685a7962fcbadd8b0af (patch)
tree32da110f5e5856a71126f023c76527fee503e1b3 /drivers/s390/cio/chp.c
parents390/boot: simplify and fix kernel memory layout setup (diff)
downloadlinux-dev-4b9e04367afe214e06736685a7962fcbadd8b0af.tar.xz
linux-dev-4b9e04367afe214e06736685a7962fcbadd8b0af.zip
s390: 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 coccicheck warnings: WARNING: use scnprintf or sprintf. Use sysfs_emit instead of scnprintf or sprintf makes more sense. Signed-off-by: Qing Wang <wangqing@vivo.com> Acked-by: Vineeth Vijayan <vneethv@linux.ibm.com> Acked-by: Stefan Haberland <sth@linux.ibm.com> Link: https://lore.kernel.org/r/1634280655-4908-1-git-send-email-wangqing@vivo.com [hca@linux.ibm.com: fix indentation] Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to '')
-rw-r--r--drivers/s390/cio/chp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/s390/cio/chp.c b/drivers/s390/cio/chp.c
index 1097e76982a5..5440f285f349 100644
--- a/drivers/s390/cio/chp.c
+++ b/drivers/s390/cio/chp.c
@@ -285,7 +285,7 @@ static ssize_t chp_configure_show(struct device *dev,
if (status < 0)
return status;
- return snprintf(buf, PAGE_SIZE, "%d\n", status);
+ return sysfs_emit(buf, "%d\n", status);
}
static int cfg_wait_idle(void);