kbuild Development List
 help / color / mirror / Atom feed
* [brauner-vfs:vfs-7.4.file 2/3] fs/tests/fdtable_kunit.c:25:9: sparse: sparse: incompatible types for operation (==):
@ 2026-09-11 11:18 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-09-11 11:18 UTC (permalink / raw)
  To: Bill Wendling
  Cc: oe-kbuild-all, Christian Brauner, Christian Brauner, Jan Kara

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git vfs-7.4.file
head:   f5ae3d9f2940d7ab17f0c186bda880e13d18bde7
commit: 501cbbd276b77d34af20ea3dd4f897c93630bac8 [2/3] vfs: Add KUnit tests for fdtable
config: alpha-randconfig-r111-20260910 (https://download.01.org/0day-ci/archive/20260911/202609111828.SjerhPyO-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 16.1.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260911/202609111828.SjerhPyO-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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609111828.SjerhPyO-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   fs/file.c:438:17: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct file **old_fds @@     got struct file [noderef] __rcu **fd @@
   fs/file.c:438:17: sparse:     expected struct file **old_fds
   fs/file.c:438:17: sparse:     got struct file [noderef] __rcu **fd
   fs/file.c:439:17: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct file **new_fds @@     got struct file [noderef] __rcu **fd @@
   fs/file.c:439:17: sparse:     expected struct file **new_fds
   fs/file.c:439:17: sparse:     got struct file [noderef] __rcu **fd
   fs/file.c:462:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
   fs/file.c:462:17: sparse:    struct file [noderef] __rcu *
   fs/file.c:462:17: sparse:    struct file *
   fs/file.c:492:60: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct file *file @@     got struct file [noderef] __rcu * @@
   fs/file.c:532:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct fdtable [noderef] __rcu *fdt @@     got struct fdtable * @@
   fs/file.c:911:30: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct file *file @@     got struct file [noderef] __rcu * @@
   fs/file.c:932:14: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct file [noderef] __rcu *file @@     got struct file * @@
   fs/file.c:936:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct file_ref_t [usertype] *ref @@     got struct file_ref_t [noderef] __rcu * @@
   fs/file.c:939:23: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct file [noderef] __rcu *file_reloaded @@     got struct file * @@
   fs/file.c:962:24: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected struct file * @@     got struct file [noderef] __rcu *file_reloaded @@
   fs/file.c:964:14: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct file * @@     got struct file [noderef] __rcu *file @@
   fs/file.c:985:22: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct file [noderef] __rcu *file @@     got struct file * @@
   fs/file.c:987:32: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected struct file * @@     got struct file [noderef] __rcu *file @@
   fs/file.c:1009:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct file [noderef] __rcu **f @@     got struct file **f @@
   fs/file.c:1009:14: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct file [noderef] __rcu *file @@     got struct file * @@
   fs/file.c:1013:16: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected struct file * @@     got struct file [noderef] __rcu *[assigned] file @@
   fs/file.c: note: in included file:
   fs/tests/fdtable_kunit.c:25:9: sparse: sparse: undefined identifier '__builtin_dynamic_object_size'
   fs/tests/fdtable_kunit.c:25:9: sparse: sparse: undefined identifier '__builtin_dynamic_object_size'
>> fs/tests/fdtable_kunit.c:25:9: sparse: sparse: incompatible types for operation (==):
   fs/tests/fdtable_kunit.c:25:9: sparse:    bad type const __left
   fs/tests/fdtable_kunit.c:25:9: sparse:    unsigned long const __right
   fs/tests/fdtable_kunit.c:54:9: sparse: sparse: undefined identifier '__builtin_dynamic_object_size'
   fs/tests/fdtable_kunit.c:54:9: sparse: sparse: undefined identifier '__builtin_dynamic_object_size'
   fs/tests/fdtable_kunit.c:54:9: sparse: sparse: incompatible types for operation (==):
   fs/tests/fdtable_kunit.c:54:9: sparse:    bad type const __left
   fs/tests/fdtable_kunit.c:54:9: sparse:    unsigned long const __right

vim +25 fs/tests/fdtable_kunit.c

     5	
     6	static void test_alloc_fdtable(struct kunit *test)
     7	{
     8		struct fdtable *fdt;
     9		unsigned int slots = 64;
    10	
    11		fdt = alloc_fdtable(slots);
    12		KUNIT_ASSERT_NOT_ERR_OR_NULL(test, fdt);
    13	
    14		/* Check that max_fds is set correctly and is >= slots */
    15		KUNIT_EXPECT_GE(test, fdt->max_fds, slots);
    16	
    17		/* Check that fd is allocated */
    18		KUNIT_ASSERT_NOT_ERR_OR_NULL(test, fdt->fd);
    19	
    20		/*
    21		 * Check dynamic object size of fdt->fd if compiler supports
    22		 * __counted_by_ptr.
    23		 */
    24	#ifdef CONFIG_CC_HAS_COUNTED_BY_PTR
  > 25		KUNIT_EXPECT_EQ(test, __builtin_dynamic_object_size(fdt->fd, 0),
    26				fdt->max_fds * sizeof(struct file *));
    27	#endif
    28	
    29		__free_fdtable(fdt);
    30	}
    31	

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

^ permalink raw reply	[flat|nested] 2+ messages in thread
* [brauner-vfs:vfs-7.4.file 2/3] fs/tests/fdtable_kunit.c:25:9: sparse: sparse: incompatible types for operation (==):
@ 2026-09-11  5:43 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-09-11  5:43 UTC (permalink / raw)
  To: Bill Wendling
  Cc: oe-kbuild-all, Christian Brauner, Christian Brauner, Jan Kara

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git vfs-7.4.file
head:   f5ae3d9f2940d7ab17f0c186bda880e13d18bde7
commit: 501cbbd276b77d34af20ea3dd4f897c93630bac8 [2/3] vfs: Add KUnit tests for fdtable
config: alpha-randconfig-r111-20260910 (https://download.01.org/0day-ci/archive/20260911/202609111337.fBSfTIpR-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 16.1.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260911/202609111337.fBSfTIpR-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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609111337.fBSfTIpR-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   fs/file.c:438:17: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct file **old_fds @@     got struct file [noderef] __rcu **fd @@
   fs/file.c:438:17: sparse:     expected struct file **old_fds
   fs/file.c:438:17: sparse:     got struct file [noderef] __rcu **fd
   fs/file.c:439:17: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct file **new_fds @@     got struct file [noderef] __rcu **fd @@
   fs/file.c:439:17: sparse:     expected struct file **new_fds
   fs/file.c:439:17: sparse:     got struct file [noderef] __rcu **fd
   fs/file.c:462:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
   fs/file.c:462:17: sparse:    struct file [noderef] __rcu *
   fs/file.c:462:17: sparse:    struct file *
   fs/file.c:492:60: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct file *file @@     got struct file [noderef] __rcu * @@
   fs/file.c:532:28: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected struct fdtable [noderef] __rcu *fdt @@     got struct fdtable * @@
   fs/file.c:911:30: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct file *file @@     got struct file [noderef] __rcu * @@
   fs/file.c:932:14: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct file [noderef] __rcu *file @@     got struct file * @@
   fs/file.c:936:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct file_ref_t [usertype] *ref @@     got struct file_ref_t [noderef] __rcu * @@
   fs/file.c:939:23: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct file [noderef] __rcu *file_reloaded @@     got struct file * @@
   fs/file.c:962:24: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected struct file * @@     got struct file [noderef] __rcu *file_reloaded @@
   fs/file.c:964:14: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct file * @@     got struct file [noderef] __rcu *file @@
   fs/file.c:985:22: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct file [noderef] __rcu *file @@     got struct file * @@
   fs/file.c:987:32: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected struct file * @@     got struct file [noderef] __rcu *file @@
   fs/file.c:1009:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct file [noderef] __rcu **f @@     got struct file **f @@
   fs/file.c:1009:14: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct file [noderef] __rcu *file @@     got struct file * @@
   fs/file.c:1013:16: sparse: sparse: incorrect type in return expression (different address spaces) @@     expected struct file * @@     got struct file [noderef] __rcu *[assigned] file @@
   fs/file.c: note: in included file:
   fs/tests/fdtable_kunit.c:25:9: sparse: sparse: undefined identifier '__builtin_dynamic_object_size'
   fs/tests/fdtable_kunit.c:25:9: sparse: sparse: undefined identifier '__builtin_dynamic_object_size'
>> fs/tests/fdtable_kunit.c:25:9: sparse: sparse: incompatible types for operation (==):
   fs/tests/fdtable_kunit.c:25:9: sparse:    bad type const __left
   fs/tests/fdtable_kunit.c:25:9: sparse:    unsigned long const __right
   fs/tests/fdtable_kunit.c:54:9: sparse: sparse: undefined identifier '__builtin_dynamic_object_size'
   fs/tests/fdtable_kunit.c:54:9: sparse: sparse: undefined identifier '__builtin_dynamic_object_size'
   fs/tests/fdtable_kunit.c:54:9: sparse: sparse: incompatible types for operation (==):
   fs/tests/fdtable_kunit.c:54:9: sparse:    bad type const __left
   fs/tests/fdtable_kunit.c:54:9: sparse:    unsigned long const __right

vim +25 fs/tests/fdtable_kunit.c

     5	
     6	static void test_alloc_fdtable(struct kunit *test)
     7	{
     8		struct fdtable *fdt;
     9		unsigned int slots = 64;
    10	
    11		fdt = alloc_fdtable(slots);
    12		KUNIT_ASSERT_NOT_ERR_OR_NULL(test, fdt);
    13	
    14		/* Check that max_fds is set correctly and is >= slots */
    15		KUNIT_EXPECT_GE(test, fdt->max_fds, slots);
    16	
    17		/* Check that fd is allocated */
    18		KUNIT_ASSERT_NOT_ERR_OR_NULL(test, fdt->fd);
    19	
    20		/*
    21		 * Check dynamic object size of fdt->fd if compiler supports
    22		 * __counted_by_ptr.
    23		 */
    24	#ifdef CONFIG_CC_HAS_COUNTED_BY_PTR
  > 25		KUNIT_EXPECT_EQ(test, __builtin_dynamic_object_size(fdt->fd, 0),
    26				fdt->max_fds * sizeof(struct file *));
    27	#endif
    28	
    29		__free_fdtable(fdt);
    30	}
    31	

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-11 11:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-11 11:18 [brauner-vfs:vfs-7.4.file 2/3] fs/tests/fdtable_kunit.c:25:9: sparse: sparse: incompatible types for operation (==): kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2026-09-11  5:43 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox