# Re: \[PATCH v2 2/2\] net: macb: fix format-truncation warning

- From: Sean Chang \<hidden\>
- Date: 2026-02-17 19:14:20 
- List: netdev
- Page: https://ratatoskr.run/netdev/2026/02/3416990
- Thread: https://ratatoskr.run/netdev/2026/02/3415746/t.md

```text
On Wed, Feb 18, 2026 at 1:46 AM Andrew Lunn [ref] wrote:
>
> Given the other patches in there series, i have to wounder, is the
> diagnostic analysis correct? Or is the RISC-V toolchain buggy?
>

I retry the different methods, I found that when I directly compile
the macb_main.c, it can trigger the same error, and I already prove
the different compiler will reach the same result, so it is not a bug
of the compiler.

I also found that the x86_64 defconfig does not enable CONFIG_MACB
because it requires CONFIG_COMMON_CLK (which is also disabled by
default on x86), whereas the RISC-V defconfig has both enabled.

>
> I do agree ethtool_sprintf() is better. But we want the commit message
> to reflect why we are making this change. Is it because
> ethtool_sprintf() is better, or are we working around toolchain bugs?
>

according to the content I mentioned upon, I think the commit will
something like "ethtool_sprintf() is better to prevent data truncation
and properly fill the 32-byte ethtool string boundary.'"

Best regards,
Sean
```
