Re: [PATCH v3 2/2] net: macb: use ethtool_sprintf to fill ethtool stats strings

From
Andrew Lunn <andrew@lunn.ch>
Date
2026-02-24 17:55:55
Also in
linux-nfs, lkml
Reply to
Sean Chang, 2026-02-24
On Wed, Feb 25, 2026 at 12:54:35AM +0800, Sean Chang wrote:
The RISC-V toolchain triggers a stringop-truncation warning when using
snprintf() with a fixed ETH_GSTRING_LEN (32 bytes) buffer.

Convert the driver to use the modern ethtool_sprintf() API from
linux/ethtool.h. This removes the need for manual snprintf() and
memcpy() calls, handles the 32-byte padding automatically, and
simplifies the logic by removing manual pointer arithmetic.

Signed-off-by: Sean Chang <redacted>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
Thread (6 messages) 6 messages, 2 authors, last reply 2026-02-25
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help