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

From
Sean Chang <hidden>
Date
2026-02-17 19:14:20
Also in
linux-nfs, lkml
Reply to
Andrew Lunn, 2026-02-17
On Wed, Feb 18, 2026 at 1:46 AM Andrew Lunn [off-list 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
Thread (11 messages) 11 messages, 2 authors, last reply 2026-02-18
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