[ammarfaizi2-block:axboe/linux-block/for-5.20/io_uring 8/34] io_uring/io_uring.c:2937:40: warning: variable 'prev' set but not used

From: kernel test robot
Date: Tue May 24 2022 - 20:18:31 EST


tree: https://github.com/ammarfaizi2/linux-block axboe/linux-block/for-5.20/io_uring
head: efc30c3b043b70c4a299df9f10a948b60ef721e3
commit: 4ad7740c8e760244c249fff910d82f4fcf214bda [8/34] io_uring: move to separate directory
config: um-i386_defconfig (https://download.01.org/0day-ci/archive/20220525/202205250842.F5Qwo4Hc-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-1) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/ammarfaizi2/linux-block/commit/4ad7740c8e760244c249fff910d82f4fcf214bda
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block axboe/linux-block/for-5.20/io_uring
git checkout 4ad7740c8e760244c249fff910d82f4fcf214bda
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=um SUBARCH=i386 SHELL=/bin/bash

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

All warnings (new ones prefixed by >>):

io_uring/io_uring.c: In function '__io_submit_flush_completions':
>> io_uring/io_uring.c:2937:40: warning: variable 'prev' set but not used [-Wunused-but-set-variable]
2937 | struct io_wq_work_node *node, *prev;
| ^~~~


vim +/prev +2937 io_uring/io_uring.c

7a743e225b2a9d fs/io_uring.c Pavel Begunkov 2020-03-03 2933
c450178d9be9dc fs/io_uring.c Pavel Begunkov 2021-09-08 2934 static void __io_submit_flush_completions(struct io_ring_ctx *ctx)
a141dd896f544d fs/io_uring.c Jens Axboe 2021-08-12 2935 __must_hold(&ctx->uring_lock)
905c172f32c56f fs/io_uring.c Pavel Begunkov 2021-02-10 2936 {
6f33b0bc4ea43f fs/io_uring.c Pavel Begunkov 2021-09-24 @2937 struct io_wq_work_node *node, *prev;
cd0ca2e048dc0d fs/io_uring.c Pavel Begunkov 2021-08-09 2938 struct io_submit_state *state = &ctx->submit_state;
905c172f32c56f fs/io_uring.c Pavel Begunkov 2021-02-10 2939
3d4aeb9f98058c fs/io_uring.c Pavel Begunkov 2021-11-10 2940 if (state->flush_cqes) {
79ebeaee8a21a0 fs/io_uring.c Jens Axboe 2021-08-10 2941 spin_lock(&ctx->completion_lock);
6f33b0bc4ea43f fs/io_uring.c Pavel Begunkov 2021-09-24 2942 wq_list_for_each(node, prev, &state->compl_reqs) {
6f33b0bc4ea43f fs/io_uring.c Pavel Begunkov 2021-09-24 2943 struct io_kiocb *req = container_of(node, struct io_kiocb,
6f33b0bc4ea43f fs/io_uring.c Pavel Begunkov 2021-09-24 2944 comp_list);
5182ed2e332e8e fs/io_uring.c Pavel Begunkov 2021-06-26 2945
0e2e5c47fed68c fs/io_uring.c Stefan Roesch 2022-04-26 2946 if (!(req->flags & REQ_F_CQE_SKIP)) {
0e2e5c47fed68c fs/io_uring.c Stefan Roesch 2022-04-26 2947 if (!(ctx->flags & IORING_SETUP_CQE32))
90e7c35fb89154 fs/io_uring.c Pavel Begunkov 2022-04-12 2948 __io_fill_cqe_req_filled(ctx, req);
0e2e5c47fed68c fs/io_uring.c Stefan Roesch 2022-04-26 2949 else
0e2e5c47fed68c fs/io_uring.c Stefan Roesch 2022-04-26 2950 __io_fill_cqe32_req_filled(ctx, req);
0e2e5c47fed68c fs/io_uring.c Stefan Roesch 2022-04-26 2951 }
905c172f32c56f fs/io_uring.c Pavel Begunkov 2021-02-10 2952 }
3d4aeb9f98058c fs/io_uring.c Pavel Begunkov 2021-11-10 2953
905c172f32c56f fs/io_uring.c Pavel Begunkov 2021-02-10 2954 io_commit_cqring(ctx);
79ebeaee8a21a0 fs/io_uring.c Jens Axboe 2021-08-10 2955 spin_unlock(&ctx->completion_lock);
905c172f32c56f fs/io_uring.c Pavel Begunkov 2021-02-10 2956 io_cqring_ev_posted(ctx);
3d4aeb9f98058c fs/io_uring.c Pavel Begunkov 2021-11-10 2957 state->flush_cqes = false;
3d4aeb9f98058c fs/io_uring.c Pavel Begunkov 2021-11-10 2958 }
5182ed2e332e8e fs/io_uring.c Pavel Begunkov 2021-06-26 2959
1cce17aca621c3 fs/io_uring.c Pavel Begunkov 2021-09-24 2960 io_free_batch_list(ctx, state->compl_reqs.first);
6f33b0bc4ea43f fs/io_uring.c Pavel Begunkov 2021-09-24 2961 INIT_WQ_LIST(&state->compl_reqs);
7a743e225b2a9d fs/io_uring.c Pavel Begunkov 2020-03-03 2962 }
7a743e225b2a9d fs/io_uring.c Pavel Begunkov 2020-03-03 2963

:::::: The code at line 2937 was first introduced by commit
:::::: 6f33b0bc4ea43f5c5ce7b7c9ab66051f80837862 io_uring: use slist for completion batching

:::::: TO: Pavel Begunkov <asml.silence@xxxxxxxxx>
:::::: CC: Jens Axboe <axboe@xxxxxxxxx>

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