[ammarfaizi2-block:axboe/linux-block/fastpoll-mshot 97/98] fs/io_uring.c:4743:11: warning: variable 'ret' is uninitialized when used here

From: kernel test robot
Date: Sun May 08 2022 - 17:45:44 EST


tree: https://github.com/ammarfaizi2/linux-block axboe/linux-block/fastpoll-mshot
head: 883f288d64ca56518398dfa59bbdbfae1215ec03
commit: 8e0d731f259198aac32de79f7059d34b94fc0fb3 [97/98] io_uring: allow allocated fixed files for openat/openat2
config: riscv-buildonly-randconfig-r005-20220508 (https://download.01.org/0day-ci/archive/20220509/202205090529.AQs5GOej-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project a385645b470e2d3a1534aae618ea56b31177639f)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/ammarfaizi2/linux-block/commit/8e0d731f259198aac32de79f7059d34b94fc0fb3
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block axboe/linux-block/fastpoll-mshot
git checkout 8e0d731f259198aac32de79f7059d34b94fc0fb3
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash

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

All warnings (new ones prefixed by >>):

>> fs/io_uring.c:4743:11: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
return ret;
^~~
fs/io_uring.c:4736:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
fs/io_uring.c:6174:2: error: call to undeclared function '__io_poll_clean'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
__io_poll_clean(req);
^
fs/io_uring.c:6174:2: note: did you mean '__io_fill_cqe'?
fs/io_uring.c:2166:20: note: '__io_fill_cqe' declared here
static inline bool __io_fill_cqe(struct io_ring_ctx *ctx, u64 user_data,
^
1 warning and 1 error generated.


vim +/ret +4743 fs/io_uring.c

4730
4731 static int io_fixed_file_install(struct io_kiocb *req, unsigned int issue_flags,
4732 struct file *file, unsigned int file_slot)
4733 {
4734 int alloc_slot = file_slot == UINT_MAX;
4735 struct io_ring_ctx *ctx = req->ctx;
4736 int ret;
4737
4738 if (alloc_slot) {
4739 io_ring_submit_lock(ctx, issue_flags);
4740 file_slot = io_file_bitmap_get(ctx);
4741 if (unlikely(file_slot < 0)) {
4742 io_ring_submit_unlock(ctx, issue_flags);
> 4743 return ret;
4744 }
4745 }
4746
4747 ret = io_install_fixed_file(req, file, issue_flags, file_slot);
4748 if (alloc_slot) {
4749 io_ring_submit_unlock(ctx, issue_flags);
4750 return file_slot;
4751 }
4752
4753 return ret;
4754 }
4755

--
0-DAY CI Kernel Test Service
https://01.org/lkp