s390/ctcm: Convert sprintf/snprintf to scnprintf
authorThorsten Winkler <twinkler@linux.ibm.com>
Wed, 21 Jun 2023 13:49:21 +0000 (15:49 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Fri, 23 Jun 2023 09:55:55 +0000 (11:55 +0200)
commit1471d85ffba7d17456670afa1b75e50234caa2c6
treed98ccc06aa26847aeb4dc1f181edabe9ba8b2b02
parentd585e4b7480615031f798ef25e4012bfe53ff135
s390/ctcm: Convert sprintf/snprintf to scnprintf

This LWN article explains the why scnprintf is preferred over snprintf
in general
https://lwn.net/Articles/69419/
Ie. snprintf() returns what *would* be the resulting length, while
scnprintf() returns the actual length.

Note that ctcm_print_statistics() writes the data into the kernel log
and is therefore not suitable for sysfs_emit(). Observable behavior is
not changed, as there may be dependencies.

Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Signed-off-by: Thorsten Winkler <twinkler@linux.ibm.com>
Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/s390/net/ctcm_dbug.c
drivers/s390/net/ctcm_main.c
drivers/s390/net/ctcm_main.h
drivers/s390/net/ctcm_mpc.c
drivers/s390/net/ctcm_sysfs.c