[PATCH net-next v10 2/5] net: spacemit: Add K1 Ethernet MAC

kernel test robot lkp at intel.com
Mon Sep 8 21:20:46 PDT 2025


Hi Vivian,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 062b3e4a1f880f104a8d4b90b767788786aa7b78]

url:    https://github.com/intel-lab-lkp/linux/commits/Vivian-Wang/dt-bindings-net-Add-support-for-SpacemiT-K1/20250908-203917
base:   062b3e4a1f880f104a8d4b90b767788786aa7b78
patch link:    https://lore.kernel.org/r/20250908-net-k1-emac-v10-2-90d807ccd469%40iscas.ac.cn
patch subject: [PATCH net-next v10 2/5] net: spacemit: Add K1 Ethernet MAC
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20250909/202509091137.JnioPegN-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250909/202509091137.JnioPegN-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 at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202509091137.JnioPegN-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In function 'emac_get_stat_tx_dropped',
       inlined from 'emac_get_stats64' at drivers/net/ethernet/spacemit/k1_emac.c:1234:24:
>> drivers/net/ethernet/spacemit/k1_emac.c:1218:24: warning: 'result' is used uninitialized [-Wuninitialized]
    1218 |                 result += READ_ONCE(per_cpu(*priv->stat_tx_dropped, cpu));
         |                        ^~
   drivers/net/ethernet/spacemit/k1_emac.c: In function 'emac_get_stats64':
   drivers/net/ethernet/spacemit/k1_emac.c:1214:13: note: 'result' was declared here
    1214 |         u64 result;
         |             ^~~~~~


vim +/result +1218 drivers/net/ethernet/spacemit/k1_emac.c

  1211	
  1212	static u64 emac_get_stat_tx_dropped(struct emac_priv *priv)
  1213	{
  1214		u64 result;
  1215		int cpu;
  1216	
  1217		for_each_possible_cpu(cpu) {
> 1218			result += READ_ONCE(per_cpu(*priv->stat_tx_dropped, cpu));
  1219		}
  1220	
  1221		return result;
  1222	}
  1223	

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



More information about the linux-riscv mailing list