lib/test_context-analysis.c:470:17: sparse: sparse: Initializer entry defined twice
From: kernel test robot
Date: Thu Dec 03 2026 - 03:05:00 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d06ce6f1eb5eeffd4ebcfde345dc34a98131d106
commit: d3febf16dee28a74b01ba43195ee4965edb6208f locking/local_lock: Support Clang's context analysis
date: 11 months ago
config: x86_64-randconfig-r2306-20261203 (https://download.01.org/0day-ci/archive/20261203/20261203085455.zwCr6oYf-lkp@xxxxxxxxx/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
sparse: v0.6.5-rc1-94-g0d159c10
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261203/20261203085455.zwCr6oYf-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
| Fixes: d3febf16dee2 ("locking/local_lock: Support Clang's context analysis")
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/20261203085455.zwCr6oYf-lkp@xxxxxxxxx/
sparse warnings: (new ones prefixed by >>)
lib/test_context-analysis.c:148:1: sparse: sparse: undefined identifier '__cond_acquire'
lib/test_context-analysis.c:83:1: sparse: sparse: context imbalance in 'test_raw_spinlock_trylock' - wrong count at exit
lib/test_context-analysis.c:83:1: sparse: sparse: context imbalance in 'test_raw_spinlock_guard' - wrong count at exit
lib/test_context-analysis.c:90:20: sparse: sparse: context imbalance in 'test_raw_spinlock_trylock_extra' - wrong count at exit
lib/test_context-analysis.c:107:1: sparse: sparse: context imbalance in 'test_spinlock_trylock' - wrong count at exit
lib/test_context-analysis.c:107:1: sparse: sparse: context imbalance in 'test_spinlock_guard' - wrong count at exit
lib/test_context-analysis.c:114:20: sparse: sparse: context imbalance in 'test_spinlock_trylock_extra' - wrong count at exit
lib/test_context-analysis.c:131:1: sparse: sparse: context imbalance in 'test_write_lock_guard' - wrong count at exit
lib/test_context-analysis.c:148:1: sparse: sparse: context imbalance in 'test_read_lock_guard' - wrong count at exit
lib/test_context-analysis.c:191:9: sparse: sparse: context imbalance in 'test_mutex_trylock' - wrong count at exit
lib/test_context-analysis.c:203:20: sparse: sparse: context imbalance in 'test_mutex_guard' - wrong count at exit
lib/test_context-analysis.c:209:20: sparse: sparse: context imbalance in 'test_mutex_cond_guard' - wrong count at exit
lib/test_context-analysis.c: note: in included file:
include/linux/seqlock.h:1255:28: sparse: sparse: context imbalance in 'test_seqlock_scoped' - unexpected unlock
lib/test_context-analysis.c:315:20: sparse: sparse: context imbalance in 'test_rwsem_guard' - wrong count at exit
lib/test_context-analysis.c:321:20: sparse: sparse: context imbalance in 'test_rwsem_cond_guard' - wrong count at exit
lib/test_context-analysis.c: note: in included file:
include/linux/rcupdate.h:908:9: sparse: sparse: context imbalance in 'test_rcu_guard' - unexpected unlock
lib/test_context-analysis.c:457:20: sparse: sparse: context imbalance in 'test_srcu_guard' - wrong count at exit
>> lib/test_context-analysis.c:470:17: sparse: sparse: Initializer entry defined twice
lib/test_context-analysis.c:470:17: sparse: also defined here
lib/test_context-analysis.c:500:20: sparse: sparse: context imbalance in 'test_local_lock_guard' - wrong count at exit
lib/test_context-analysis.c:514:17: sparse: sparse: Initializer entry defined twice
lib/test_context-analysis.c:514:17: sparse: also defined here
lib/test_context-analysis.c:530:17: sparse: sparse: context imbalance in 'test_local_trylock' - unexpected unlock
vim +470 lib/test_context-analysis.c
468
469 static DEFINE_PER_CPU(struct test_local_lock_data, test_local_lock_data) = {
> 470 .lock = INIT_LOCAL_LOCK(lock),
471 };
472
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki