]> git.baikalelectronics.ru Git - kernel.git/commit
null_blk: cast command status to integer
authorJens Axboe <axboe@kernel.dk>
Fri, 10 Dec 2021 23:32:44 +0000 (16:32 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 10 Dec 2021 23:32:44 +0000 (16:32 -0700)
commit3735fecdb25e3b3d76e1e316023ae1f2c0dce8d3
tree0223b266414cae5920ada980f67d4399a0596f0d
parent1617e37ae7ad9ea5f6630509e05f315ed207605e
null_blk: cast command status to integer

kernel test robot reports that sparse now triggers a warning on null_blk:

>> drivers/block/null_blk/main.c:1577:55: sparse: sparse: incorrect type in argument 3 (different base types) @@     expected int ioerror @@     got restricted blk_status_t [usertype] error @@
   drivers/block/null_blk/main.c:1577:55: sparse:     expected int ioerror
   drivers/block/null_blk/main.c:1577:55: sparse:     got restricted blk_status_t [usertype] error

because blk_mq_add_to_batch() takes an integer instead of a blk_status_t.
Just cast this to an integer to silence it, null_blk is the odd one out
here since the command status is the "right" type. If we change the
function type, then we'll have do that for other callers too (existing and
future ones).

Fixes: b6d9a07e000b ("block: null_blk: batched complete poll requests")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/null_blk/main.c