* [ammarfaizi2-block:axboe/linux-block/for-6.3/io_uring 37/41] io_uring/io_uring.c:2373:8: warning: type qualifiers ignored on function return type
@ 2023-01-24 1:20 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-01-24 1:20 UTC (permalink / raw)
To: Pavel Begunkov
Cc: oe-kbuild-all, Ammar Faizi, GNU/Weeb Mailing List, Jens Axboe
tree: https://github.com/ammarfaizi2/linux-block axboe/linux-block/for-6.3/io_uring
head: 73b62ca46fe7e10334f601643c2ccd4fca4a4874
commit: d5a6846a1c5fc7b864b63e90d136a3af6034e37c [37/41] io_uring: improve io_get_sqe
config: openrisc-randconfig-r023-20230123 (https://download.01.org/0day-ci/archive/20230124/[email protected]/config)
compiler: or1k-linux-gcc (GCC) 12.1.0
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
# https://github.com/ammarfaizi2/linux-block/commit/d5a6846a1c5fc7b864b63e90d136a3af6034e37c
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block axboe/linux-block/for-6.3/io_uring
git checkout d5a6846a1c5fc7b864b63e90d136a3af6034e37c
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=openrisc olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 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]>
All warnings (new ones prefixed by >>):
io_uring/io_uring.c: In function '__io_submit_flush_completions':
io_uring/io_uring.c:1481:40: warning: variable 'prev' set but not used [-Wunused-but-set-variable]
1481 | struct io_wq_work_node *node, *prev;
| ^~~~
io_uring/io_uring.c: At top level:
>> io_uring/io_uring.c:2373:8: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
2373 | static const bool io_get_sqe(struct io_ring_ctx *ctx, const struct io_uring_sqe **sqe)
| ^~~~~
vim +2373 io_uring/io_uring.c
2364
2365 /*
2366 * Fetch an sqe, if one is available. Note this returns a pointer to memory
2367 * that is mapped by userspace. This means that care needs to be taken to
2368 * ensure that reads are stable, as we cannot rely on userspace always
2369 * being a good citizen. If members of the sqe are validated and then later
2370 * used, it's important that those reads are done through READ_ONCE() to
2371 * prevent a re-load down the line.
2372 */
> 2373 static const bool io_get_sqe(struct io_ring_ctx *ctx, const struct io_uring_sqe **sqe)
2374 {
2375 unsigned head, mask = ctx->sq_entries - 1;
2376 unsigned sq_idx = ctx->cached_sq_head++ & mask;
2377
2378 /*
2379 * The cached sq head (or cq tail) serves two purposes:
2380 *
2381 * 1) allows us to batch the cost of updating the user visible
2382 * head updates.
2383 * 2) allows the kernel side to track the head on its own, even
2384 * though the application is the one updating it.
2385 */
2386 head = READ_ONCE(ctx->sq_array[sq_idx]);
2387 if (likely(head < ctx->sq_entries)) {
2388 /* double index for 128-byte SQEs, twice as long */
2389 if (ctx->flags & IORING_SETUP_SQE128)
2390 head <<= 1;
2391 *sqe = &ctx->sq_sqes[head];
2392 return true;
2393 }
2394
2395 /* drop invalid entries */
2396 ctx->cq_extra--;
2397 WRITE_ONCE(ctx->rings->sq_dropped,
2398 READ_ONCE(ctx->rings->sq_dropped) + 1);
2399 return false;
2400 }
2401
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-01-24 1:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-24 1:20 [ammarfaizi2-block:axboe/linux-block/for-6.3/io_uring 37/41] io_uring/io_uring.c:2373:8: warning: type qualifiers ignored on function return type kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox