[tip:locking/core 9/15] kernel/futex/core.c:62:16: sparse: sparse: cast truncates bits from constant value (123456789abcdef becomes 89abcdef)

kernel test robot <[email protected]> Thu, 06 Aug 2026 18:46:58 +0800
Newsgroups dev.linux.lists.oe-kbuild-all,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Hi Peter,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core
head:   1c7efabfbaf796f11000a46094a69955a01ec6cc
commit: b78b0b65825275f58336a43611a700de174be8c3 [9/15] futex: Use runtime constants for __futex_hash() hot path
config: i386-randconfig-r132-20260806 (https://download.01.org/0day-ci/archive/20260806/[email protected]/config)
compiler: gcc-13 (Debian 13.3.0-16) 13.3.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260806/[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]/

sparse warnings: (new ones prefixed by >>)
   kernel/futex/core.c:532:38: sparse: sparse: cast removes address space '__user' of expression
   kernel/futex/core.c:532:51: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int [noderef] [usertype] __user *naddr @@     got void * @@
   kernel/futex/core.c:532:51: sparse:     expected unsigned int [noderef] [usertype] __user *naddr
   kernel/futex/core.c:532:51: sparse:     got void *
   kernel/futex/core.c:548:38: sparse: sparse: cast removes address space '__user' of expression
   kernel/futex/core.c:548:51: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected unsigned int [noderef] [usertype] __user *naddr @@     got void * @@
   kernel/futex/core.c:548:51: sparse:     expected unsigned int [noderef] [usertype] __user *naddr
   kernel/futex/core.c:548:51: sparse:     got void *
>> kernel/futex/core.c:62:16: sparse: sparse: cast truncates bits from constant value (123456789abcdef becomes 89abcdef)

vim +62 kernel/futex/core.c

    59	
    60	static __always_inline struct futex_hash_bucket **futex_queues(void)
    61	{
  > 62		return runtime_const_ptr(__futex_queues);
    63	}
    64	

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