public inbox for [email protected]
 help / color / mirror / Atom feed
From: "Vincenzo Palazzo" <[email protected]>
To: "Jens Axboe" <[email protected]>, "io-uring" <[email protected]>
Subject: Re: [PATCH] io_uring: silence variable ‘prev’ set but not used warning
Date: Thu, 09 Mar 2023 18:06:09 +0100	[thread overview]
Message-ID: <CR20M0PWOJZM.2KMRHEWFCKY5J@vincent-arch> (raw)
In-Reply-To: <[email protected]>

> If io_uring.o is built with W=1, it triggers a warning:
>
> io_uring/io_uring.c: In function ?__io_submit_flush_completions?:
> io_uring/io_uring.c:1502:40: warning: variable ?prev? set but not used [-Wunused-but-set-variable]
>  1502 |         struct io_wq_work_node *node, *prev;
>       |                                        ^~~~
>
> which is due to the wq_list_for_each() iterator always keeping a 'prev'
> variable. Most users need this to remove an entry from a list, for
> example, but __io_submit_flush_completions() never does that.
>
> Add a basic helper that doesn't track prev instead, and use that in
> that function.
>
> Reported-by: Vincenzo Palazzo <[email protected]>
> Signed-off-by: Jens Axboe <[email protected]>
>
> ---

Nice, I should pay more attention to the implementation
and maybe propose the equal patch before.

But anyway thanks to rework it.

Reviewed-by: Vincenzo Palazzo <[email protected]>

  reply	other threads:[~2023-03-09 17:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09 16:58 [PATCH] io_uring: silence variable ‘prev’ set but not used warning Jens Axboe
2023-03-09 17:06 ` Vincenzo Palazzo [this message]
2023-03-09 18:34   ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2023-03-09 16:54 Jens Axboe

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 \
    --in-reply-to=CR20M0PWOJZM.2KMRHEWFCKY5J@vincent-arch \
    [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