Re: [PATCH] md/raid10: fix: incompatible types in comparison expression (different address spaces).

From: kernel test robot
Date: Sun Dec 27 2020 - 06:44:24 EST


Hi YANG,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on song-md/md-next]
[also build test WARNING on v5.10 next-20201223]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/YANG-LI/md-raid10-fix-incompatible-types-in-comparison-expression-different-address-spaces/20201222-160648
base: git://git.kernel.org/pub/scm/linux/kernel/git/song/md.git md-next
config: sparc-randconfig-s031-20201222 (attached as .config)
compiler: sparc64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-184-g1b896707-dirty
# https://github.com/0day-ci/linux/commit/6efb13c7253fb18a4e7844bdb367008c3f13ec7b
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review YANG-LI/md-raid10-fix-incompatible-types-in-comparison-expression-different-address-spaces/20201222-160648
git checkout 6efb13c7253fb18a4e7844bdb367008c3f13ec7b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=sparc

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


"sparse warnings: (new ones prefixed by >>)"
drivers/md/raid10.c:5128:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *replacement @@
drivers/md/raid10.c:5128:22: sparse: expected struct md_rdev *rdev
drivers/md/raid10.c:5128:22: sparse: got struct md_rdev [noderef] __rcu *replacement
drivers/md/raid10.c:5131:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *rdev @@
drivers/md/raid10.c:5131:22: sparse: expected struct md_rdev *rdev
drivers/md/raid10.c:5131:22: sparse: got struct md_rdev [noderef] __rcu *rdev
drivers/md/raid10.c:442:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *replacement @@
drivers/md/raid10.c:442:22: sparse: expected struct md_rdev *rdev
drivers/md/raid10.c:442:22: sparse: got struct md_rdev [noderef] __rcu *replacement
drivers/md/raid10.c:446:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *rdev @@
drivers/md/raid10.c:446:22: sparse: expected struct md_rdev *rdev
drivers/md/raid10.c:446:22: sparse: got struct md_rdev [noderef] __rcu *rdev
drivers/md/raid10.c:1226:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *replacement @@
drivers/md/raid10.c:1226:22: sparse: expected struct md_rdev *rdev
drivers/md/raid10.c:1226:22: sparse: got struct md_rdev [noderef] __rcu *replacement
drivers/md/raid10.c:1230:30: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *rdev @@
drivers/md/raid10.c:1230:30: sparse: expected struct md_rdev *rdev
drivers/md/raid10.c:1230:30: sparse: got struct md_rdev [noderef] __rcu *rdev
drivers/md/raid10.c:1233:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *rdev @@
drivers/md/raid10.c:1233:22: sparse: expected struct md_rdev *rdev
drivers/md/raid10.c:1233:22: sparse: got struct md_rdev [noderef] __rcu *rdev
drivers/md/raid10.c:1247:60: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected unsigned long const volatile *addr @@ got unsigned long [noderef] __rcu * @@
drivers/md/raid10.c:1247:60: sparse: expected unsigned long const volatile *addr
drivers/md/raid10.c:1247:60: sparse: got unsigned long [noderef] __rcu *
drivers/md/raid10.c:1576:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *replacement @@
drivers/md/raid10.c:1576:22: sparse: expected struct md_rdev *rdev
drivers/md/raid10.c:1576:22: sparse: got struct md_rdev [noderef] __rcu *replacement
drivers/md/raid10.c:1583:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *rdev @@
drivers/md/raid10.c:1583:22: sparse: expected struct md_rdev *rdev
drivers/md/raid10.c:1583:22: sparse: got struct md_rdev [noderef] __rcu *rdev
drivers/md/raid10.c:1982:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *rdev @@
drivers/md/raid10.c:1982:22: sparse: expected struct md_rdev *rdev
drivers/md/raid10.c:1982:22: sparse: got struct md_rdev [noderef] __rcu *rdev
drivers/md/raid10.c:2015:46: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected unsigned long const volatile *addr @@ got unsigned long [noderef] __rcu * @@
drivers/md/raid10.c:2015:46: sparse: expected unsigned long const volatile *addr
drivers/md/raid10.c:2015:46: sparse: got unsigned long [noderef] __rcu *
drivers/md/raid10.c:2016:55: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected unsigned long volatile *addr @@ got unsigned long [noderef] __rcu * @@
drivers/md/raid10.c:2016:55: sparse: expected unsigned long volatile *addr
drivers/md/raid10.c:2016:55: sparse: got unsigned long [noderef] __rcu *
drivers/md/raid10.c:2019:65: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected unsigned long volatile *addr @@ got unsigned long [noderef] __rcu * @@
drivers/md/raid10.c:2019:65: sparse: expected unsigned long volatile *addr
drivers/md/raid10.c:2019:65: sparse: got unsigned long [noderef] __rcu *
drivers/md/raid10.c:2026:53: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected unsigned long volatile *addr @@ got unsigned long [noderef] __rcu * @@
drivers/md/raid10.c:2026:53: sparse: expected unsigned long volatile *addr
drivers/md/raid10.c:2026:53: sparse: got unsigned long [noderef] __rcu *
drivers/md/raid10.c:2033:53: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected unsigned long const volatile *addr @@ got unsigned long [noderef] __rcu * @@
drivers/md/raid10.c:2033:53: sparse: expected unsigned long const volatile *addr
drivers/md/raid10.c:2033:53: sparse: got unsigned long [noderef] __rcu *
drivers/md/raid10.c:2034:62: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected unsigned long volatile *addr @@ got unsigned long [noderef] __rcu * @@
drivers/md/raid10.c:2034:62: sparse: expected unsigned long volatile *addr
drivers/md/raid10.c:2034:62: sparse: got unsigned long [noderef] __rcu *
drivers/md/raid10.c:2080:58: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected unsigned long const volatile *addr @@ got unsigned long [noderef] __rcu * @@
drivers/md/raid10.c:2080:58: sparse: expected unsigned long const volatile *addr
drivers/md/raid10.c:2080:58: sparse: got unsigned long [noderef] __rcu *
drivers/md/raid10.c:2124:18: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid10.c:2124:18: sparse: struct md_rdev *
drivers/md/raid10.c:2124:18: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid10.c:2126:23: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid10.c:2126:23: sparse: struct md_rdev *
drivers/md/raid10.c:2126:23: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid10.c:2141:48: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid10.c:2141:48: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid10.c:2141:48: sparse: struct md_rdev *
>> drivers/md/raid10.c:2187:45: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected struct atomic_t [usertype] * @@ got struct atomic_t [noderef] __rcu * @@
drivers/md/raid10.c:2192:42: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *rdev @@
drivers/md/raid10.c:2260:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *replacement @@
drivers/md/raid10.c:2262:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *rdev @@
drivers/md/raid10.c:2341:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *rdev @@
drivers/md/raid10.c:2387:45: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct atomic_t [usertype] *v @@ got struct atomic_t [noderef] __rcu * @@
drivers/md/raid10.c:2391:57: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected unsigned long const volatile *addr @@ got unsigned long [noderef] __rcu * @@
drivers/md/raid10.c:2462:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *rdev @@
drivers/md/raid10.c:2470:30: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *rdev @@
drivers/md/raid10.c:2492:34: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid10.c:2492:34: sparse: struct md_rdev *
drivers/md/raid10.c:2492:34: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid10.c:2543:45: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct atomic_t [usertype] *v @@ got struct atomic_t [noderef] __rcu * @@
drivers/md/raid10.c:2548:45: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct atomic_t [usertype] *v @@ got struct atomic_t [noderef] __rcu * @@
drivers/md/raid10.c:2634:14: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *rdev @@
drivers/md/raid10.c:2703:30: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev *[assigned] rdev @@ got struct md_rdev [noderef] __rcu *rdev @@
drivers/md/raid10.c:2813:70: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *rdev @@
drivers/md/raid10.c:2918:30: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *rdev @@
drivers/md/raid10.c:2934:30: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *replacement @@
drivers/md/raid10.c:2958:30: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *rdev @@
drivers/md/raid10.c:2975:30: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *replacement @@
drivers/md/raid10.c:3571:72: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected unsigned long const volatile *addr @@ got unsigned long [noderef] __rcu * @@
drivers/md/raid10.c:3697:74: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *rdev @@
drivers/md/raid10.c:3702:65: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct md_rdev *rdev @@ got struct md_rdev [noderef] __rcu *replacement @@
drivers/md/raid10.c:4088:43: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev [noderef] __rcu *replacement @@ got struct md_rdev *[assigned] rdev @@
drivers/md/raid10.c:4092:36: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct md_rdev [noderef] __rcu *rdev @@ got struct md_rdev *[assigned] rdev @@
drivers/md/raid10.c:4150:53: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected unsigned long volatile *addr @@ got unsigned long [noderef] __rcu * @@
drivers/md/raid10.c:4154:45: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected unsigned long const volatile *addr @@ got unsigned long [noderef] __rcu * @@
drivers/md/raid10.c:4163:45: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected unsigned long const volatile *addr @@ got unsigned long [noderef] __rcu * @@
drivers/md/raid10.c:2014:27: sparse: sparse: dereference of noderef expression
drivers/md/raid10.c:2028:44: sparse: sparse: dereference of noderef expression
drivers/md/raid10.c:2028:44: sparse: sparse: dereference of noderef expression
drivers/md/raid10.c:2030:53: sparse: sparse: dereference of noderef expression
drivers/md/raid10.c:2030:53: sparse: sparse: dereference of noderef expression
drivers/md/raid10.c:2032:34: sparse: sparse: dereference of noderef expression
drivers/md/raid10.c:2036:53: sparse: sparse: dereference of noderef expression
drivers/md/raid10.c:2036:53: sparse: sparse: dereference of noderef expression
drivers/md/raid10.c:2389:46: sparse: sparse: dereference of noderef expression
drivers/md/raid10.c:2389:46: sparse: sparse: dereference of noderef expression
drivers/md/raid10.c:2393:60: sparse: sparse: dereference of noderef expression
drivers/md/raid10.c:2394:17: sparse: sparse: dereference of noderef expression
drivers/md/raid10.c:2394:17: sparse: sparse: dereference of noderef expression
drivers/md/raid10.c:2394:17: sparse: sparse: dereference of noderef expression
drivers/md/raid10.c:2412:46: sparse: sparse: dereference of noderef expression
drivers/md/raid10.c:2412:46: sparse: sparse: dereference of noderef expression
drivers/md/raid10.c:2544:46: sparse: sparse: dereference of noderef expression
drivers/md/raid10.c:2544:46: sparse: sparse: dereference of noderef expression
drivers/md/raid10.c:2549:46: sparse: sparse: dereference of noderef expression
drivers/md/raid10.c:2549:46: sparse: sparse: dereference of noderef expression
drivers/md/raid10.c:4158:33: sparse: sparse: dereference of noderef expression
drivers/md/raid10.c:4164:25: sparse: sparse: dereference of noderef expression

vim +2187 drivers/md/raid10.c

^1da177e4c3f415 Linus Torvalds 2005-04-16 2175
81fa152008ac903 Ming Lei 2017-03-17 2176 static void __end_sync_read(struct r10bio *r10_bio, struct bio *bio, int d)
^1da177e4c3f415 Linus Torvalds 2005-04-16 2177 {
e879a8793f915aa NeilBrown 2011-10-11 2178 struct r10conf *conf = r10_bio->mddev->private;
0eb3ff12aa8a125 NeilBrown 2006-01-06 2179
4e4cbee93d56137 Christoph Hellwig 2017-06-03 2180 if (!bio->bi_status)
0eb3ff12aa8a125 NeilBrown 2006-01-06 2181 set_bit(R10BIO_Uptodate, &r10_bio->state);
e684e41db3bad44 NeilBrown 2011-07-28 2182 else
e684e41db3bad44 NeilBrown 2011-07-28 2183 /* The write handler will notice the lack of
e684e41db3bad44 NeilBrown 2011-07-28 2184 * R10BIO_Uptodate and record any errors etc
e684e41db3bad44 NeilBrown 2011-07-28 2185 */
4dbcdc751cb25ff NeilBrown 2006-01-06 2186 atomic_add(r10_bio->sectors,
4dbcdc751cb25ff NeilBrown 2006-01-06 @2187 &conf->mirrors[d].rdev->corrected_errors);
^1da177e4c3f415 Linus Torvalds 2005-04-16 2188
^1da177e4c3f415 Linus Torvalds 2005-04-16 2189 /* for reconstruct, we always reschedule after a read.
^1da177e4c3f415 Linus Torvalds 2005-04-16 2190 * for resync, only after all reads
^1da177e4c3f415 Linus Torvalds 2005-04-16 2191 */
73d5c38a9536142 NeilBrown 2009-02-25 2192 rdev_dec_pending(conf->mirrors[d].rdev, conf->mddev);
^1da177e4c3f415 Linus Torvalds 2005-04-16 2193 if (test_bit(R10BIO_IsRecover, &r10_bio->state) ||
^1da177e4c3f415 Linus Torvalds 2005-04-16 2194 atomic_dec_and_test(&r10_bio->remaining)) {
^1da177e4c3f415 Linus Torvalds 2005-04-16 2195 /* we have read all the blocks,
^1da177e4c3f415 Linus Torvalds 2005-04-16 2196 * do the comparison in process context in raid10d
^1da177e4c3f415 Linus Torvalds 2005-04-16 2197 */
^1da177e4c3f415 Linus Torvalds 2005-04-16 2198 reschedule_retry(r10_bio);
^1da177e4c3f415 Linus Torvalds 2005-04-16 2199 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 2200 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 2201

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

Attachment: .config.gz
Description: application/gzip