diff options
author | Qing Wang <wangqing@vivo.com> | 2021-10-15 08:50:24 +0200 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2021-10-24 16:25:42 +0200 |
commit | 7bc9ab0f42b3a640af8b2c60aa3a616056c1f47c (patch) | |
tree | 95e2b26ad8e196e65193a41838b24841f77db365 /drivers/net/can/janz-ican3.c | |
parent | can: dev: add can_tdc_get_relative_tdco() helper function (diff) | |
download | linux-7bc9ab0f42b3a640af8b2c60aa3a616056c1f47c.tar.xz linux-7bc9ab0f42b3a640af8b2c60aa3a616056c1f47c.zip |
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>
Diffstat (limited to 'drivers/net/can/janz-ican3.c')
-rw-r--r-- | drivers/net/can/janz-ican3.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c index c68ad56628bd..32006dbf5abd 100644 --- a/drivers/net/can/janz-ican3.c +++ b/drivers/net/can/janz-ican3.c @@ -1831,7 +1831,7 @@ static ssize_t termination_show(struct device *dev, return -ETIMEDOUT; } - return snprintf(buf, PAGE_SIZE, "%u\n", mod->termination_enabled); + return sysfs_emit(buf, "%u\n", mod->termination_enabled); } static ssize_t termination_store(struct device *dev, |