Re: [PATCH v5 2/2] net: macb: use ethtool_sprintf to fill ethtool stats strings
From: Andy Shevchenko
Date: Mon Mar 02 2026 - 08:25:24 EST
On Sun, Mar 01, 2026 at 02:08:21AM +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.
This can go separately from patch 1. Dunno why this is a series...
And this one LGTM,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
--
With Best Regards,
Andy Shevchenko