aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi.c
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2022-02-18 14:58:35 +0100
committerMark Brown <broonie@kernel.org>2022-02-18 14:39:07 +0000
commit043786303b175977e515d4e99cf6b5f886b136dc (patch)
treef3a477080ea44e7130af1ff78a53245c204e4f57 /drivers/spi/spi.c
parentspi: clean up some inconsistent indenting (diff)
downloadlinux-dev-043786303b175977e515d4e99cf6b5f886b136dc.tar.xz
linux-dev-043786303b175977e515d4e99cf6b5f886b136dc.zip
spi: use sysfs_emit() for printing statistics and add trailing newline
Use dedicated function sysfs_emit() that does some extra checking, e.g. to ensure that no more than PAGESIZE bytes are written. In addition add a trailing newline to the output, that makes it better readable from the console. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://lore.kernel.org/r/56e1588d-d53b-73e9-fdc8-7fe30bf91f11@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi.c')
-rw-r--r--drivers/spi/spi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 85f8ae4cc0c0..cd4dc3131e17 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -143,7 +143,7 @@ static ssize_t spi_statistics_##name##_show(struct spi_statistics *stat, \
unsigned long flags; \
ssize_t len; \
spin_lock_irqsave(&stat->lock, flags); \
- len = sprintf(buf, format_string, stat->field); \
+ len = sysfs_emit(buf, format_string "\n", stat->field); \
spin_unlock_irqrestore(&stat->lock, flags); \
return len; \
} \