Re: [PATCH] sparse: use identifiers to define address spaces

From: kernel test robot
Date: Thu Jun 18 2020 - 12:59:02 EST


Hi Luc,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linux/master]
[also build test WARNING on linus/master v5.8-rc1 next-20200618]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Luc-Van-Oostenryck/sparse-use-identifiers-to-define-address-spaces/20200618-060614
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git a5dc8300df75e8b8384b4c82225f1e4a0b4d9b55
config: x86_64-randconfig-s031-20200618 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-rc1-10-gc17b1b06-dirty
# save the attached .config to linux build tree
make W=1 C=1 ARCH=x86_64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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


sparse warnings: (new ones prefixed by >>)

>> fs/f2fs/trace.c:142:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void **slot @@ got void [noderef] __rcu ** @@
fs/f2fs/trace.c:142:9: sparse: expected void **slot
>> fs/f2fs/trace.c:142:9: sparse: got void [noderef] __rcu **
>> fs/f2fs/trace.c:142:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void **slot @@ got void [noderef] __rcu ** @@
fs/f2fs/trace.c:142:9: sparse: expected void **slot
>> fs/f2fs/trace.c:142:9: sparse: got void [noderef] __rcu **
>> fs/f2fs/trace.c:142:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __rcu **slot @@ got void **slot @@
>> fs/f2fs/trace.c:142:9: sparse: expected void [noderef] __rcu **slot
fs/f2fs/trace.c:142:9: sparse: got void **slot
>> fs/f2fs/trace.c:142:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void **slot @@ got void [noderef] __rcu ** @@
fs/f2fs/trace.c:142:9: sparse: expected void **slot
>> fs/f2fs/trace.c:142:9: sparse: got void [noderef] __rcu **
--
kernel/sched/core.c:512:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct task_struct *curr @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/core.c:512:38: sparse: expected struct task_struct *curr
kernel/sched/core.c:512:38: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/core.c:567:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/core.c:567:9: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/core.c:567:9: sparse: got struct sched_domain [noderef] __rcu *parent
kernel/sched/core.c:1432:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct task_struct *p @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/core.c:1432:33: sparse: expected struct task_struct *p
kernel/sched/core.c:1432:33: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/core.c:1432:68: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct task_struct *tsk @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/core.c:1432:68: sparse: expected struct task_struct *tsk
kernel/sched/core.c:1432:68: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/core.c:2176:17: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] __rcu *parent @@
kernel/sched/core.c:2176:17: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/core.c:2176:17: sparse: got struct sched_domain [noderef] __rcu *parent
kernel/sched/core.c:2342:36: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct task_struct const *p @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/core.c:2342:36: sparse: expected struct task_struct const *p
kernel/sched/core.c:2342:36: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/core.c:3650:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct task_struct *curr @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/core.c:3650:38: sparse: expected struct task_struct *curr
kernel/sched/core.c:3650:38: sparse: got struct task_struct [noderef] __rcu *curr
>> kernel/sched/core.c:3735:14: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct task_struct *curr @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/core.c:3735:14: sparse: expected struct task_struct *curr
kernel/sched/core.c:3735:14: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/core.c:4083:14: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct task_struct *prev @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/core.c:4083:14: sparse: expected struct task_struct *prev
kernel/sched/core.c:4083:14: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/core.c:4506:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/core.c:4506:17: sparse: struct task_struct *
kernel/sched/core.c:4506:17: sparse: struct task_struct [noderef] __rcu *
kernel/sched/core.c:4705:22: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/core.c:4705:22: sparse: struct task_struct [noderef] __rcu *
kernel/sched/core.c:4705:22: sparse: struct task_struct *
kernel/sched/core.c:8011:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct task_struct *p @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/core.c:8011:25: sparse: expected struct task_struct *p
kernel/sched/core.c:8011:25: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/pelt.h:80:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct task_struct const *p @@ got struct task_struct [noderef] __rcu *curr @@
kernel/sched/pelt.h:80:13: sparse: expected struct task_struct const *p
kernel/sched/pelt.h:80:13: sparse: got struct task_struct [noderef] __rcu *curr
kernel/sched/core.c:1415:33: sparse: sparse: dereference of noderef expression
kernel/sched/core.c:1416:19: sparse: sparse: dereference of noderef expression
kernel/sched/core.c:1419:40: sparse: sparse: dereference of noderef expression
kernel/sched/sched.h:1657:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:1657:25: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:1657:25: sparse: struct task_struct *
kernel/sched/sched.h:1803:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:1803:9: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:1803:9: sparse: struct task_struct *
kernel/sched/sched.h:1809:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:1809:9: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:1809:9: sparse: struct task_struct *
kernel/sched/core.c:1388:38: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/core.c:1388:38: sparse: struct task_struct [noderef] __rcu *
kernel/sched/core.c:1388:38: sparse: struct task_struct const *
kernel/sched/sched.h:1657:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:1657:25: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:1657:25: sparse: struct task_struct *
kernel/sched/sched.h:1803:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:1803:9: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:1803:9: sparse: struct task_struct *
kernel/sched/sched.h:1803:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:1803:9: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:1803:9: sparse: struct task_struct *
kernel/sched/sched.h:1657:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:1657:25: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:1657:25: sparse: struct task_struct *
kernel/sched/sched.h:1803:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:1803:9: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:1803:9: sparse: struct task_struct *
kernel/sched/sched.h:1809:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:1809:9: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:1809:9: sparse: struct task_struct *
kernel/sched/sched.h:1657:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:1657:25: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:1657:25: sparse: struct task_struct *
kernel/sched/sched.h:1803:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:1803:9: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:1803:9: sparse: struct task_struct *
kernel/sched/sched.h:1809:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:1809:9: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:1809:9: sparse: struct task_struct *
kernel/sched/sched.h:1657:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:1657:25: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:1657:25: sparse: struct task_struct *
kernel/sched/sched.h:1803:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:1803:9: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:1803:9: sparse: struct task_struct *
kernel/sched/sched.h:1809:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:1809:9: sparse: struct task_struct [noderef] __rcu *
kernel/sched/sched.h:1809:9: sparse: struct task_struct *
--
>> drivers/mtd/maps/nettel.c:179:25: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/mtd/maps/nettel.c:223:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void *static [assigned] [toplevel] nettel_mmcrp @@
>> drivers/mtd/maps/nettel.c:223:25: sparse: expected void volatile [noderef] __iomem *addr
drivers/mtd/maps/nettel.c:223:25: sparse: got void *static [assigned] [toplevel] nettel_mmcrp
drivers/mtd/maps/nettel.c:416:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void *static [assigned] [toplevel] nettel_mmcrp @@
drivers/mtd/maps/nettel.c:416:17: sparse: expected void volatile [noderef] __iomem *addr
drivers/mtd/maps/nettel.c:416:17: sparse: got void *static [assigned] [toplevel] nettel_mmcrp
drivers/mtd/maps/nettel.c:434:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void *static [assigned] [toplevel] nettel_mmcrp @@
drivers/mtd/maps/nettel.c:434:25: sparse: expected void volatile [noderef] __iomem *addr
drivers/mtd/maps/nettel.c:434:25: sparse: got void *static [assigned] [toplevel] nettel_mmcrp
--
>> net/netfilter/nf_tables_api.c:1405:25: sparse: sparse: cast between address spaces (__percpu -> __rcu)
net/netfilter/nf_tables_api.c:1405:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
>> net/netfilter/nf_tables_api.c:1405:25: sparse: struct nft_stats [noderef] __rcu *
>> net/netfilter/nf_tables_api.c:1405:25: sparse: struct nft_stats [noderef] __percpu *
>> net/netfilter/nf_tables_api.c:1567:31: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected struct nft_stats [noderef] __percpu * @@ got void * @@
net/netfilter/nf_tables_api.c:1570:31: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected struct nft_stats [noderef] __percpu * @@ got void * @@
net/netfilter/nf_tables_api.c:1574:31: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected struct nft_stats [noderef] __percpu * @@ got void * @@
net/netfilter/nf_tables_api.c:1596:17: sparse: sparse: cast between address spaces (__percpu -> __rcu)
net/netfilter/nf_tables_api.c:1596:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
net/netfilter/nf_tables_api.c:1596:17: sparse: struct nft_stats [noderef] __rcu *
net/netfilter/nf_tables_api.c:1596:17: sparse: struct nft_stats [noderef] __percpu *
net/netfilter/nf_tables_api.c:1596:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
net/netfilter/nf_tables_api.c:1596:17: sparse: struct nft_stats [noderef] __rcu *
net/netfilter/nf_tables_api.c:1596:17: sparse: struct nft_stats [noderef] __percpu *
net/netfilter/nf_tables_api.c:1639:21: sparse: sparse: cast between address spaces (__percpu -> __rcu)
net/netfilter/nf_tables_api.c:1639:21: sparse: sparse: incompatible types in comparison expression (different address spaces):
net/netfilter/nf_tables_api.c:1639:21: sparse: struct nft_stats [noderef] __rcu *
net/netfilter/nf_tables_api.c:1639:21: sparse: struct nft_stats [noderef] __percpu *
net/netfilter/nf_tables_api.c:1947:25: sparse: sparse: cast between address spaces (__percpu -> __rcu)
net/netfilter/nf_tables_api.c:1947:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
net/netfilter/nf_tables_api.c:1947:25: sparse: struct nft_stats [noderef] __rcu *
net/netfilter/nf_tables_api.c:1947:25: sparse: struct nft_stats [noderef] __percpu *
>> net/netfilter/nf_tables_api.c:2097:23: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct nft_stats *stats @@ got struct nft_stats [noderef] __percpu * @@
>> net/netfilter/nf_tables_api.c:2108:38: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct nft_stats [noderef] __percpu *stats @@ got struct nft_stats *stats @@
>> net/netfilter/nf_tables_api.c:2144:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __percpu *__pdata @@ got struct nft_stats *stats @@
include/linux/rcupdate.h:686:9: sparse: sparse: context imbalance in 'nft_netlink_dump_start_rcu' - unexpected unlock
--
>> fs/coda/upcall.c:618:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
fs/coda/upcall.c:618:31: sparse: expected struct spinlock [usertype] *lock
>> fs/coda/upcall.c:618:31: sparse: got struct spinlock [noderef] __rcu *
fs/coda/upcall.c:627:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
fs/coda/upcall.c:627:33: sparse: expected struct spinlock [usertype] *lock
fs/coda/upcall.c:627:33: sparse: got struct spinlock [noderef] __rcu *
fs/coda/upcall.c:632:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
fs/coda/upcall.c:632:31: sparse: expected struct spinlock [usertype] *lock
fs/coda/upcall.c:632:31: sparse: got struct spinlock [noderef] __rcu *
fs/coda/upcall.c:635:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
fs/coda/upcall.c:635:33: sparse: expected struct spinlock [usertype] *lock
fs/coda/upcall.c:635:33: sparse: got struct spinlock [noderef] __rcu *

vim +142 fs/f2fs/trace.c

351f4fba843db3 Jaegeuk Kim 2015-01-07 130
351f4fba843db3 Jaegeuk Kim 2015-01-07 131 #define PIDVEC_SIZE 128
351f4fba843db3 Jaegeuk Kim 2015-01-07 132 static unsigned int gang_lookup_pids(pid_t *results, unsigned long first_index,
351f4fba843db3 Jaegeuk Kim 2015-01-07 133 unsigned int max_items)
351f4fba843db3 Jaegeuk Kim 2015-01-07 134 {
351f4fba843db3 Jaegeuk Kim 2015-01-07 135 struct radix_tree_iter iter;
351f4fba843db3 Jaegeuk Kim 2015-01-07 136 void **slot;
351f4fba843db3 Jaegeuk Kim 2015-01-07 137 unsigned int ret = 0;
351f4fba843db3 Jaegeuk Kim 2015-01-07 138
351f4fba843db3 Jaegeuk Kim 2015-01-07 139 if (unlikely(!max_items))
351f4fba843db3 Jaegeuk Kim 2015-01-07 140 return 0;
351f4fba843db3 Jaegeuk Kim 2015-01-07 141
351f4fba843db3 Jaegeuk Kim 2015-01-07 @142 radix_tree_for_each_slot(slot, &pids, &iter, first_index) {
351f4fba843db3 Jaegeuk Kim 2015-01-07 143 results[ret] = iter.index;
b0beab5016d040 Sheng Yong 2017-03-08 144 if (++ret == max_items)
351f4fba843db3 Jaegeuk Kim 2015-01-07 145 break;
351f4fba843db3 Jaegeuk Kim 2015-01-07 146 }
351f4fba843db3 Jaegeuk Kim 2015-01-07 147 return ret;
351f4fba843db3 Jaegeuk Kim 2015-01-07 148 }
351f4fba843db3 Jaegeuk Kim 2015-01-07 149

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

Attachment: .config.gz
Description: application/gzip