Re: [PATCH net-next v12 05/15] ax88179_178a: Add netdev2data() convenience function

From: netdev-bot+sashiko

Date: Thu Sep 17 2026 - 19:49:59 EST


Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider:

Critical: 0 · High: 0 · Medium: 0 · Low: 1

- [Low] drivers/net/usb/ax88179_lib.c:131 adds the globally visible
helper netdev2data() which has no caller at this commit, and the…

--

ax88179_178a: Add netdev2data() convenience function

This adds a small non-static helper netdev2data() to ax88179_lib.c, plus
its prototype in ax88179_lib.h, which returns the ax88179_data structure
belonging to a net_device via netdev_priv() and usbnet->driver_priv.

> diff --git a/drivers/net/usb/ax88179_lib.c b/drivers/net/usb/ax88179_lib.c
> index 761701ebc0692..ea36aef3d3e45 100644
> --- a/drivers/net/usb/ax88179_lib.c
> +++ b/drivers/net/usb/ax88179_lib.c
> @@ -128,6 +128,13 @@ int ax88179_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
> return ret;
> }
>
> +struct ax88179_data *netdev2data(struct net_device *net)
> +{
> + struct usbnet *dev = netdev_priv(net);
> +
> + return dev->driver_priv;
> +}
> +

[Severity: Low]
This isn't a bug, but netdev2data() has no caller at this point in the
series, and the commit message describes the users in the present tense:

Add a convenience function for the ethtool ops that use
phylink and need to retrieve the ax88179_data structure from
net_device.

Checking the end of the series, the callers do arrive later: the patch
adding HW support for AX179A-based chips introduces
drivers/net/usb/ax88179a_devices.c, and together with the follow-ups it
calls netdev2data() from ax88179a_get_drvinfo(),
ax88179a_get_pauseparam(), ax88179a_set_pauseparam(),
ax88179a_get_eeprom_len(), ax88179a_get_eee(), ax88179a_set_eee() and
ax88179a_mii_ioctl().

Would it be clearer to say the ethtool ops using this helper are added in
a following patch of this series?

Also, the existing open-coded netdev_priv() plus driver_priv sequences in
ax88179_lib.c and ax88179_178a.c are left as they are. Was leaving them
unconverted intentional, or is that planned as a separate cleanup?

> void ax88179_status(struct usbnet *dev, struct urb *urb)
> {
> struct ax88179_int_data *event;

[ ... ]

--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260916-ax88179a-v12-0-60c04c9924a2%40birger-koblitz.de