mbox series

[net,v2,0/2] net: phy: Fix potential string cut when using PHY_ID_FMT

Message ID 20250319105813.3102076-1-andriy.shevchenko@linux.intel.com (mailing list archive)
Headers show
Series net: phy: Fix potential string cut when using PHY_ID_FMT | expand

Message

Andy Shevchenko March 19, 2025, 10:54 a.m. UTC
The agreement and also PHY_MAX_ADDR limit suggests that the PHY id can't occupy
more than 2 hex digits. In some cases GCC complains about potential string cut.
Avoid that by limiting specifier to print only 2 hex digits (patch 1).
With that, fix the ASIX driver that triggers GCC and use agreed + 3 in the size
of the phy_name (patch 2).

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

Andy Shevchenko (2):
  net: phy: Fix formatting specifier to avoid potential string cuts
  net: usb: asix: ax88772: Increase phy_name size

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