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

Nikolay Aleksandrov <[email protected]>
Newsgroups gmane.linux.network.bridge
Message-ID <c3c66f54-1197-4123-bc31-2cd941b58ed7__3874.4965962664$1770105147$gmane$org@blackwall.org>
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 <[email protected]>
> ---
> v3: Fix whitespace issue.
> v2: https://lore.kernel.org/bridge/0100019c1d2d46e0-a083f912-ac82-47e8-8cbb-ac9d70355ed3-000000@email.amazonses.com/
>      Fix alignment of sysfs_emit arguments.
> v1: https://lore.kernel.org/bridge/0100019c14f90490-950ddd9b-1897-4111-bddd-0d4b8abf380a-000000@email.amazonses.com/
>      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 <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.