can: at91/janz-ican3: replace snprintf() in show functions with sysfs_emit()
authorQing Wang <wangqing@vivo.com>
Fri, 15 Oct 2021 06:50:24 +0000 (23:50 -0700)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sun, 24 Oct 2021 14:25:42 +0000 (16:25 +0200)
commit7bc9ab0f42b3a640af8b2c60aa3a616056c1f47c
tree95e2b26ad8e196e65193a41838b24841f77db365
parentfa759a9395ea81c17db613dde43c46f0607df7e7
can: at91/janz-ican3: replace snprintf() in show functions with sysfs_emit()

The sysfs show() functions must not use snprintf() when formatting the
value to be returned to user space.

Fix the following coccicheck warning:
| drivers/net/can/at91_can.c:1185: WARNING: use scnprintf or sprintf.
| drivers/net/can/janz-ican3.c:1834: WARNING: use scnprintf or sprintf.
|
| Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Link: https://lore.kernel.org/all/1634280624-4816-1-git-send-email-wangqing@vivo.com
Signed-off-by: Qing Wang <wangqing@vivo.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/at91_can.c
drivers/net/can/janz-ican3.c