Thread (4 messages) 4 messages, 4 authors, 2026-02-04

Re: [PATCH net-next v3] net: bridge: use sysfs_emit instead of sprintf

From: Nikolay Aleksandrov <razor@blackwall.org>
Date: 2026-02-03 07:51:27
Also in: bridge, lkml

On 02/02/2026 21:09, David Corvaglia wrote:
Replace sprintf with sysfs_emit in sysfs show() methods as outlined in
Documentation/filesystems/sysfs.rst.

sysfs_emit is preferred to sprintf in sysfs show() methods as it is safer
with buffer handling.

Signed-off-by: David Corvaglia <redacted>
---
v3: Fix whitespace issue.
v2: https://lore.kernel.org/bridge/0100019c1d2d46e0-a083f912-ac82-47e8-8cbb-ac9d70355ed3-000000@email.amazonses.com/ (local)
     Fix alignment of sysfs_emit arguments.
v1: https://lore.kernel.org/bridge/0100019c14f90490-950ddd9b-1897-4111-bddd-0d4b8abf380a-000000@email.amazonses.com/ (local)
     This is my first patch to the kernel! I've been able to build and boot
     with the patch. I also tested the sysfs reads and they seem to be
     correct. Any feedback is appreciated.

  net/bridge/br_stp_if.c   |   8 +--
  net/bridge/br_sysfs_br.c | 108 +++++++++++++++++++--------------------
  net/bridge/br_sysfs_if.c |  32 ++++++------
  3 files changed, 73 insertions(+), 75 deletions(-)
LGTM
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help