All of lore.kernel.org
 help / color / mirror / Atom feed
* [intel-lts:pr/59 1/1] drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:309:7: warning: this statement may fall through
@ 2025-02-21  7:12 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-02-21  7:12 UTC (permalink / raw)
  Cc: oe-kbuild-all

tree:   https://github.com/intel/linux-intel-lts.git pr/59
head:   19ae9bc73680fd6c1c95edb5b7e2aaa790e7f011
commit: 67cd9a997f1bfb5dedf407ad540232912bd04b10 [1/1] net: hns: Use phy_driver to setup Phy loopback
config: xtensa-randconfig-002-20250218 (https://download.01.org/0day-ci/archive/20250221/202502211515.UVZCsumx-lkp@intel.com/config)
compiler: xtensa-linux-gcc (GCC) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250221/202502211515.UVZCsumx-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502211515.UVZCsumx-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from include/linux/skbuff.h:17,
                    from include/linux/if_ether.h:23,
                    from include/linux/etherdevice.h:25,
                    from drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:10:
   include/linux/dma-mapping.h: In function 'dma_map_resource':
   arch/xtensa/include/asm/page.h:185:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
            ^
   include/linux/compiler.h:179:42: note: in definition of macro 'unlikely'
    # define unlikely(x) __builtin_expect(!!(x), 0)
                                             ^
   include/linux/dma-mapping.h:308:2: note: in expansion of macro 'BUG_ON'
     BUG_ON(pfn_valid(PHYS_PFN(phys_addr)));
     ^~~~~~
   include/linux/dma-mapping.h:308:9: note: in expansion of macro 'pfn_valid'
     BUG_ON(pfn_valid(PHYS_PFN(phys_addr)));
            ^~~~~~~~~
   drivers/net/ethernet/hisilicon/hns/hns_ethtool.c: In function '__lb_setup':
>> drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:309:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
      ret = hns_nic_config_phy_loopback(phy_dev, 0x0);
      ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:310:2: note: here
     case MAC_LOOP_NONE:
     ^~~~
   In file included from include/linux/string.h:18:0,
                    from include/linux/bitmap.h:8,
                    from include/linux/cpumask.h:11,
                    from include/linux/mm_types_task.h:13,
                    from include/linux/mm_types.h:4,
                    from include/linux/kmemcheck.h:4,
                    from include/linux/skbuff.h:18,
                    from include/linux/if_ether.h:23,
                    from include/linux/etherdevice.h:25,
                    from drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:10:
   drivers/net/ethernet/hisilicon/hns/hns_ethtool.c: In function 'hns_nic_get_drvinfo':
   arch/xtensa/include/asm/string.h:56:42: warning: array subscript is above array bounds [-Warray-bounds]
      : "0" (__dest), "1" (__src), "r" (__src+__n)
                                        ~~~~~^~~~
   arch/xtensa/include/asm/string.h:56:42: warning: array subscript is above array bounds [-Warray-bounds]
      : "0" (__dest), "1" (__src), "r" (__src+__n)
                                        ~~~~~^~~~
   arch/xtensa/include/asm/string.h:56:42: warning: array subscript is above array bounds [-Warray-bounds]
      : "0" (__dest), "1" (__src), "r" (__src+__n)
                                        ~~~~~^~~~


vim +309 drivers/net/ethernet/hisilicon/hns/hns_ethtool.c

   284	
   285	static int __lb_setup(struct net_device *ndev,
   286			      enum hnae_loop loop)
   287	{
   288		int ret = 0;
   289		struct hns_nic_priv *priv = netdev_priv(ndev);
   290		struct phy_device *phy_dev = ndev->phydev;
   291		struct hnae_handle *h = priv->ae_handle;
   292	
   293		switch (loop) {
   294		case MAC_INTERNALLOOP_PHY:
   295			ret = hns_nic_config_phy_loopback(phy_dev, 0x1);
   296			if (!ret)
   297				ret = h->dev->ops->set_loopback(h, loop, 0x1);
   298			break;
   299		case MAC_INTERNALLOOP_MAC:
   300			if ((h->dev->ops->set_loopback) &&
   301			    (priv->ae_handle->phy_if != PHY_INTERFACE_MODE_XGMII))
   302				ret = h->dev->ops->set_loopback(h, loop, 0x1);
   303			break;
   304		case MAC_INTERNALLOOP_SERDES:
   305			if (h->dev->ops->set_loopback)
   306				ret = h->dev->ops->set_loopback(h, loop, 0x1);
   307			break;
   308		case MAC_LOOP_PHY_NONE:
 > 309			ret = hns_nic_config_phy_loopback(phy_dev, 0x0);
   310		case MAC_LOOP_NONE:
   311			if (!ret && h->dev->ops->set_loopback) {
   312				if (priv->ae_handle->phy_if != PHY_INTERFACE_MODE_XGMII)
   313					ret = h->dev->ops->set_loopback(h,
   314						MAC_INTERNALLOOP_MAC, 0x0);
   315	
   316				if (!ret)
   317					ret = h->dev->ops->set_loopback(h,
   318						MAC_INTERNALLOOP_SERDES, 0x0);
   319			}
   320			break;
   321		default:
   322			ret = -EINVAL;
   323			break;
   324		}
   325	
   326		if (!ret) {
   327			if (loop == MAC_LOOP_NONE)
   328				h->dev->ops->set_promisc_mode(
   329					h, ndev->flags & IFF_PROMISC);
   330			else
   331				h->dev->ops->set_promisc_mode(h, 1);
   332		}
   333		return ret;
   334	}
   335	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-02-21  7:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-21  7:12 [intel-lts:pr/59 1/1] drivers/net/ethernet/hisilicon/hns/hns_ethtool.c:309:7: warning: this statement may fall through kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.