GNU/Weeb Mailing List <[email protected]>
 help / color / mirror / Atom feed
From: kernel test robot <[email protected]>
To: Pavel Begunkov <[email protected]>
Cc: [email protected],
	Ammar Faizi <[email protected]>,
	GNU/Weeb Mailing List <[email protected]>,
	Jens Axboe <[email protected]>
Subject: [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
Date: Tue, 24 Jan 2023 09:20:30 +0800	[thread overview]
Message-ID: <[email protected]> (raw)

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

                 reply	other threads:[~2023-01-24  1:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox