[peterz-queue:locking/core 6/7] kernel/locking/lockdep.c:6017:57: error: use of undeclared identifier 'offset'

From: kernel test robot
Date: Sat Feb 12 2022 - 01:29:56 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git locking/core
head: 2300c94a775d0f2a733ef11285cc0abe8126edf6
commit: 065af96d73df2653a2d7da572cf8ba57218479ef [6/7] locking/lockdep: Cleanup reinit_class()
config: hexagon-buildonly-randconfig-r006-20220211 (https://download.01.org/0day-ci/archive/20220212/202202121417.yBYvheMJ-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project c7eb84634519e6497be42f5fe323f9a04ed67127)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?id=065af96d73df2653a2d7da572cf8ba57218479ef
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue locking/core
git checkout 065af96d73df2653a2d7da572cf8ba57218479ef
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

>> kernel/locking/lockdep.c:6017:57: error: use of undeclared identifier 'offset'
BUILD_BUG_ON(offsetof(struct lock_class, lock_entry) > offset);
^
kernel/locking/lockdep.c:6018:58: error: use of undeclared identifier 'offset'
BUILD_BUG_ON(offsetof(struct lock_class, locks_after) > offset);
^
kernel/locking/lockdep.c:6019:59: error: use of undeclared identifier 'offset'
BUILD_BUG_ON(offsetof(struct lock_class, locks_before) > offset);
^
3 errors generated.


vim +/offset +6017 kernel/locking/lockdep.c

6011
6012 static void reinit_class(struct lock_class *class)
6013 {
6014 WARN_ON_ONCE(!class->lock_entry.next);
6015 WARN_ON_ONCE(!list_empty(&class->locks_after));
6016 WARN_ON_ONCE(!list_empty(&class->locks_before));
> 6017 BUILD_BUG_ON(offsetof(struct lock_class, lock_entry) > offset);
6018 BUILD_BUG_ON(offsetof(struct lock_class, locks_after) > offset);
6019 BUILD_BUG_ON(offsetof(struct lock_class, locks_before) > offset);
6020 memset_startat(class, 0, key);
6021 }
6022

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx