netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v3 0/2] net: usb: asix: ax88772: Fix potential string cut
@ 2025-03-24 14:39 Andy Shevchenko
  2025-03-24 14:39 ` [PATCH net v3 1/2] net: phy: Introduce PHY_ID_SIZE — minimum size for PHY ID string Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Andy Shevchenko @ 2025-03-24 14:39 UTC (permalink / raw)
  To: Andy Shevchenko, linux-usb, netdev, linux-kernel
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Heiner Kallweit, Russell King

The agreement and also PHY_MAX_ADDR limit suggest that the PHY address
can't occupy more than two hex digits. In some cases GCC complains about
potential string cut. In course of fixing this, introduce the PHY_ID_SIZE
predefined constant to make it easier for the users to know the bare
minimum for the buffer that holds PHY ID string (patch 1). With that,
fix the ASIX driver that triggers GCC accordingly (patch 2).

In v3:
- dropped format specifier changes (Russell, LKP)
- added predefined constant for a minimum buffer size (Russell)
- updated error message to refer to the address and not ID string (Russell)
- changed type of phy_addr to u8, otherwise GCC can't cope with its range

In v2:
- added first patch
- added a conditional to the ASIX driver (Andrew)

Andy Shevchenko (2):
  net: phy: Introduce PHY_ID_SIZE — minimum size for PHY ID string
  net: usb: asix: ax88772: Increase phy_name size

 drivers/net/usb/ax88172a.c | 12 ++++++++----
 include/linux/phy.h        |  1 +
 2 files changed, 9 insertions(+), 4 deletions(-)

-- 
2.47.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-03-25 22:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-24 14:39 [PATCH net v3 0/2] net: usb: asix: ax88772: Fix potential string cut Andy Shevchenko
2025-03-24 14:39 ` [PATCH net v3 1/2] net: phy: Introduce PHY_ID_SIZE — minimum size for PHY ID string Andy Shevchenko
2025-03-24 15:06   ` Russell King (Oracle)
2025-03-24 15:57     ` Andy Shevchenko
2025-03-24 17:38       ` Russell King (Oracle)
2025-03-24 19:52         ` Andy Shevchenko
2025-03-24 14:39 ` [PATCH net v3 2/2] net: usb: asix: ax88772: Increase phy_name size Andy Shevchenko
2025-03-25 22:50 ` [PATCH net v3 0/2] net: usb: asix: ax88772: Fix potential string cut patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).