[frank-w-bpi-r2-4.14:7.2-rc 164/164] drivers/net/ethernet/mediatek/mtk_eth_soc.c:5651:13: warning: variable 'flags' set but not used

kernel test robot <[email protected]> Tue, 28 Jul 2026 08:41:46 +0800
Newsgroups dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
tree:   https://github.com/frank-w/BPI-R2-4.14 7.2-rc
head:   23918d7eab97daf57988a8a538a870c4e862b525
commit: 9f04fd76bc18f52ae96c6487be54d8c8bedca353 [164/164] net: pcs: mtk-lynxi: add phya tx rx clock path
config: powerpc-allmodconfig (https://download.01.org/0day-ci/archive/20260728/[email protected]/config)
compiler: powerpc64-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260728/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/mediatek/mtk_eth_soc.c: In function 'mtk_sgmii_init':
>> drivers/net/ethernet/mediatek/mtk_eth_soc.c:5651:13: warning: variable 'flags' set but not used [-Wunused-but-set-variable=]
    5651 |         u32 flags = 0;
         |             ^~~~~


vim +/flags +5651 drivers/net/ethernet/mediatek/mtk_eth_soc.c

  5646	
  5647	static int mtk_sgmii_init(struct mtk_eth *eth)
  5648	{
  5649		struct device_node *np;
  5650		struct regmap *regmap;
> 5651		u32 flags = 0;
  5652		int i;
  5653	
  5654		for (i = 0; i < MTK_MAX_DEVS; i++) {
  5655			np = of_parse_phandle(eth->dev->of_node, "mediatek,sgmiisys", i);
  5656			if (!np)
  5657				break;
  5658	
  5659			regmap = syscon_node_to_regmap(np);
  5660			if (IS_ERR(regmap)) {
  5661				of_node_put(np);
  5662	
  5663			if (of_property_read_bool(np->parent, "mediatek,phya_trx_ck"))
  5664				flags |= MTK_SGMII_FLAG_PHYA_TRX_CK;
  5665	
  5666			of_node_put(np);
  5667	
  5668			if (IS_ERR(regmap))
  5669				return PTR_ERR(regmap);
  5670			}
  5671	
  5672			eth->sgmii_pcs[i] = mtk_pcs_lynxi_create(eth->dev,
  5673								 of_fwnode_handle(np),
  5674								 regmap,
  5675								 eth->soc->ana_rgc3);
  5676			of_node_put(np);
  5677		}
  5678	
  5679		return 0;
  5680	}
  5681	

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