* [PATCH RESEND] spi: use sysfs_emit() for printing statistics and add trailing newline
@ 2022-02-18 13:58 Heiner Kallweit
2022-02-18 15:18 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Heiner Kallweit @ 2022-02-18 13:58 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-spi
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>
---
drivers/spi/spi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index c98c55f44..fae290a33 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -144,7 +144,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; \
} \
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH RESEND] spi: use sysfs_emit() for printing statistics and add trailing newline
2022-02-18 13:58 [PATCH RESEND] spi: use sysfs_emit() for printing statistics and add trailing newline Heiner Kallweit
@ 2022-02-18 15:18 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2022-02-18 15:18 UTC (permalink / raw)
To: Heiner Kallweit; +Cc: linux-spi
On Fri, 18 Feb 2022 14:58:35 +0100, Heiner Kallweit wrote:
> 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.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: use sysfs_emit() for printing statistics and add trailing newline
commit: 043786303b175977e515d4e99cf6b5f886b136dc
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-18 15:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-18 13:58 [PATCH RESEND] spi: use sysfs_emit() for printing statistics and add trailing newline Heiner Kallweit
2022-02-18 15:18 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).