[jimc:folio-pool-v2-lockdep 16/21] kernel/locking/lockdep_internals.h:248:16: error: use of undeclared identifier 'lock_classes'; did you mean 'nr_lock_classes'?

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
tree:   https://github.com/jimc/linux.git folio-pool-v2-lockdep
head:   e77ee8289ea0755b0ee299348504d4568f942d71
commit: 9e99b37a40c36adbf813b758582f9b57aa5e41e3 [16/21] locking/lockdep: Migrate lock_classes array to 2-level dynamic folio chunks
config: powerpc-randconfig-002-20260818 (https://download.01.org/0day-ci/archive/20260819/[email protected]/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 844a18e753e822736c9805ab779144b647a2c186)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260819/[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 errors (new ones prefixed by >>):

   In file included from kernel/locking/lockdep.c:84:
>> kernel/locking/lockdep_internals.h:248:16: error: use of undeclared identifier 'lock_classes'; did you mean 'nr_lock_classes'?
     248 |         idx = class - lock_classes;
         |                       ^~~~~~~~~~~~
         |                       nr_lock_classes
   kernel/locking/lockdep_internals.h:139:22: note: 'nr_lock_classes' declared here
     139 | extern unsigned long nr_lock_classes;
         |                      ^
>> kernel/locking/lockdep_internals.h:248:6: error: incompatible pointer to integer conversion assigning to 'int' from 'struct lock_class *' [-Wint-conversion]
     248 |         idx = class - lock_classes;
         |             ^ ~~~~~~~~~~~~~~~~~~~~
   kernel/locking/lockdep_internals.h:257:16: error: use of undeclared identifier 'lock_classes'; did you mean 'nr_lock_classes'?
     257 |         idx = class - lock_classes;
         |                       ^~~~~~~~~~~~
         |                       nr_lock_classes
   kernel/locking/lockdep_internals.h:139:22: note: 'nr_lock_classes' declared here
     139 | extern unsigned long nr_lock_classes;
         |                      ^
   kernel/locking/lockdep_internals.h:257:6: error: incompatible pointer to integer conversion assigning to 'int' from 'struct lock_class *' [-Wint-conversion]
     257 |         idx = class - lock_classes;
         |             ^ ~~~~~~~~~~~~~~~~~~~~
   4 errors generated.


vim +248 kernel/locking/lockdep_internals.h

8ca2b56cd7da98 Waiman Long 2018-10-03  243  
8ca2b56cd7da98 Waiman Long 2018-10-03  244  static inline void debug_class_ops_inc(struct lock_class *class)
8ca2b56cd7da98 Waiman Long 2018-10-03  245  {
8ca2b56cd7da98 Waiman Long 2018-10-03  246  	int idx;
8ca2b56cd7da98 Waiman Long 2018-10-03  247  
8ca2b56cd7da98 Waiman Long 2018-10-03 @248  	idx = class - lock_classes;
8ca2b56cd7da98 Waiman Long 2018-10-03  249  	__debug_atomic_inc(lock_class_ops[idx]);
8ca2b56cd7da98 Waiman Long 2018-10-03  250  }
8ca2b56cd7da98 Waiman Long 2018-10-03  251  

:::::: The code at line 248 was first introduced by commit
:::::: 8ca2b56cd7da98fc8f8d787bb706b9d6c8674a3b locking/lockdep: Make class->ops a percpu counter and move it under CONFIG_DEBUG_LOCKDEP=y

:::::: TO: Waiman Long <[email protected]>
:::::: CC: Ingo Molnar <[email protected]>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.