mbox series

[net,v3,0/2] net: usb: asix: ax88772: Fix potential string cut

Message ID 20250324144751.1271761-1-andriy.shevchenko@linux.intel.com (mailing list archive)
Headers show
Series net: usb: asix: ax88772: Fix potential string cut | expand

Message

Andy Shevchenko March 24, 2025, 2:39 p.m. UTC
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(-)

Comments

patchwork-bot+netdevbpf@kernel.org March 25, 2025, 10:50 p.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 24 Mar 2025 16:39:28 +0200 you wrote:
> 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).
> 
> [...]

Here is the summary with links:
  - [net,v3,1/2] net: phy: Introduce PHY_ID_SIZE — minimum size for PHY ID string
    https://git.kernel.org/netdev/net-next/c/2c5ac026fd14
  - [net,v3,2/2] net: usb: asix: ax88772: Increase phy_name size
    https://git.kernel.org/netdev/net-next/c/61997271a5a7

You are awesome, thank you!