Skip to contentSkip to conversation

block/blk-merge.c:984:42: sparse: sparse: incorrect type in initializer (different base types)

PATCH kernel test robot 2 participants 2 messages Feb 16, 2023 – Feb 17, 2023

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://github.com/ammarfaizi2/linux-block axboe/linux-block/for-6.3/block
head:   67205f80be9910207481406c47f7d85e703fb2e9
commit: 3481d9424950159b1dbd366a14acab79f1440bbf [148/148] block: sync mixed merged request's failfast with 1st bio's
config: openrisc-randconfig-s042-20230213 (https://download.01.org/0day-ci/archive/20230217/[email protected]/config)
compiler: or1k-linux-gcc (GCC) 12.1.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.4-39-gce1a6720-dirty
# https://github.com/ammarfaizi2/linux-block/commit/3481d9424950159b1dbd366a14acab79f1440bbf
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block axboe/linux-block/for-6.3/block
git checkout 3481d9424950159b1dbd366a14acab79f1440bbf
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=openrisc olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=openrisc SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)

>> block/blk-merge.c:984:42: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted blk_opf_t const [usertype] ff @@     got unsigned int @@
   block/blk-merge.c:984:42: sparse:     expected restricted blk_opf_t const [usertype] ff
   block/blk-merge.c:984:42: sparse:     got unsigned int
   block/blk-merge.c:1010:42: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted blk_opf_t const [usertype] ff @@     got unsigned int @@
   block/blk-merge.c:1010:42: sparse:     expected restricted blk_opf_t const [usertype] ff
   block/blk-merge.c:1010:42: sparse:     got unsigned int
>> block/blk-merge.c:763:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected unsigned int @@     got restricted blk_opf_t @@
   block/blk-merge.c:763:24: sparse:     expected unsigned int
   block/blk-merge.c:763:24: sparse:     got restricted blk_opf_t
   block/blk-merge.c:765:28: sparse: sparse: incorrect type in return expression (different base types) @@     expected unsigned int @@     got restricted blk_opf_t @@
   block/blk-merge.c:765:28: sparse:     expected unsigned int
   block/blk-merge.c:765:28: sparse:     got restricted blk_opf_t
>> block/blk-merge.c:763:24: sparse: sparse: incorrect type in return expression (different base types) @@     expected unsigned int @@     got restricted blk_opf_t @@

block/blk-merge.c:763:24: sparse: expected unsigned int
block/blk-merge.c:763:24: sparse: got restricted blk_opf_t
block/blk-merge.c:765:28: sparse: sparse: incorrect type in return expression (different base types) @@ expected unsigned int @@ got restricted blk_opf_t @@
block/blk-merge.c:765:28: sparse: expected unsigned int
block/blk-merge.c:765:28: sparse: got restricted blk_opf_t

vim +984 block/blk-merge.c

980
981 static enum bio_merge_status bio_attempt_back_merge(struct request *req,
982 struct bio *bio, unsigned int nr_segs)
983 {

 > 984		const blk_opf_t ff = bio_failfast(bio);

985
986 if (!ll_back_merge_fn(req, bio, nr_segs))
987 return BIO_MERGE_FAILED;
988
989 trace_block_bio_backmerge(bio);
990 rq_qos_merge(req->q, req, bio);
991
992 if ((req->cmd_flags & REQ_FAILFAST_MASK) != ff)
993 blk_rq_set_mixed_merge(req);
994
995 blk_update_mixed_merge(req, bio, false);
996
997 req->biotail->bi_next = bio;
998 req->biotail = bio;
999 req->__data_len += bio->bi_iter.bi_size;
1000
1001 bio_crypt_free_ctx(bio);
1002
1003 blk_account_io_merge_bio(req);
1004 return BIO_MERGE_OK;
1005 }
1006

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
#1 lore raw
Quoted 13 lines · kernel test robot

sparse warnings: (new ones prefixed by >>)

Quoted 1 line
Quoted 1 line

block/blk-merge.c:984:42: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted blk_opf_t const [usertype] ff @@ got unsigned int @@

block/blk-merge.c:984:42: sparse: expected restricted blk_opf_t const [usertype] ff
block/blk-merge.c:984:42: sparse: got unsigned int
block/blk-merge.c:1010:42: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted blk_opf_t const [usertype] ff @@ got unsigned int @@
block/blk-merge.c:1010:42: sparse: expected restricted blk_opf_t const [usertype] ff
block/blk-merge.c:1010:42: sparse: got unsigned int

Quoted 1 line
Quoted 1 line

block/blk-merge.c:763:24: sparse: sparse: incorrect type in return expression (different base types) @@ expected unsigned int @@ got restricted blk_opf_t @@

block/blk-merge.c:763:24: sparse: expected unsigned int
block/blk-merge.c:763:24: sparse: got restricted blk_opf_t
block/blk-merge.c:765:28: sparse: sparse: incorrect type in return expression (different base types) @@ expected unsigned int @@ got restricted blk_opf_t @@
block/blk-merge.c:765:28: sparse: expected unsigned int
block/blk-merge.c:765:28: sparse: got restricted blk_opf_t

Quoted 6 lines
Quoted 1 line
Quoted 1 line

block/blk-merge.c:763:24: sparse: sparse: incorrect type in return expression (different base types) @@ expected unsigned int @@ got restricted blk_opf_t @@

block/blk-merge.c:763:24: sparse: expected unsigned int
block/blk-merge.c:763:24: sparse: got restricted blk_opf_t
block/blk-merge.c:765:28: sparse: sparse: incorrect type in return expression (different base types) @@ expected unsigned int @@ got restricted blk_opf_t @@
block/blk-merge.c:765:28: sparse: expected unsigned int
block/blk-merge.c:765:28: sparse: got restricted blk_opf_t

I fixed this up, thanks for the report.

Signature · 1 line
Jens Axboe