Re: [PATCH net-next v6 2/7] net: ethtool: plumb PHY stats to PHY drivers

From: kernel test robot
Date: Thu Jan 09 2025 - 23:49:08 EST


Hi Oleksij,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url: https://github.com/intel-lab-lkp/linux/commits/Oleksij-Rempel/ethtool-linkstate-migrate-linkstate-functions-to-support-multi-PHY-setups/20250109-174927
base: net-next/main
patch link: https://lore.kernel.org/r/20250109094457.97466-3-o.rempel%40pengutronix.de
patch subject: [PATCH net-next v6 2/7] net: ethtool: plumb PHY stats to PHY drivers
config: arc-axs101_defconfig (https://download.01.org/0day-ci/archive/20250110/202501101219.XbI23MZj-lkp@xxxxxxxxx/config)
compiler: arc-elf-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250110/202501101219.XbI23MZj-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501101219.XbI23MZj-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/net/phy/phy.c:631: warning: expecting prototype for phy_ethtool_get_phy_stats(). Prototype was for __phy_ethtool_get_phy_stats() instead
>> drivers/net/phy/phy.c:650: warning: expecting prototype for phy_ethtool_get_link_ext_stats(). Prototype was for __phy_ethtool_get_link_ext_stats() instead


vim +631 drivers/net/phy/phy.c

617
618 /**
619 * phy_ethtool_get_phy_stats - Retrieve standardized PHY statistics
620 * @phydev: Pointer to the PHY device
621 * @phy_stats: Pointer to ethtool_eth_phy_stats structure
622 * @phydev_stats: Pointer to ethtool_phy_stats structure
623 *
624 * Fetches PHY statistics using a kernel-defined interface for consistent
625 * diagnostics. Unlike phy_ethtool_get_stats(), which allows custom stats,
626 * this function enforces a standardized format for better interoperability.
627 */
628 void __phy_ethtool_get_phy_stats(struct phy_device *phydev,
629 struct ethtool_eth_phy_stats *phy_stats,
630 struct ethtool_phy_stats *phydev_stats)
> 631 {
632 if (!phydev->drv || !phydev->drv->get_phy_stats)
633 return;
634
635 mutex_lock(&phydev->lock);
636 phydev->drv->get_phy_stats(phydev, phy_stats, phydev_stats);
637 mutex_unlock(&phydev->lock);
638 }
639
640 /**
641 * phy_ethtool_get_link_ext_stats - Retrieve extended link statistics for a PHY
642 * @phydev: Pointer to the PHY device
643 * @link_stats: Pointer to the structure to store extended link statistics
644 *
645 * Populates the ethtool_link_ext_stats structure with link down event counts
646 * and additional driver-specific link statistics, if available.
647 */
648 void __phy_ethtool_get_link_ext_stats(struct phy_device *phydev,
649 struct ethtool_link_ext_stats *link_stats)
> 650 {
651 link_stats->link_down_events = READ_ONCE(phydev->link_down_events);
652
653 if (!phydev->drv || !phydev->drv->get_link_stats)
654 return;
655
656 mutex_lock(&phydev->lock);
657 phydev->drv->get_link_stats(phydev, link_stats);
658 mutex_unlock(&phydev->lock);
659 }
660

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki