public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: Breno Leitao <[email protected]>,
	Pavel Begunkov <[email protected]>,
	[email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: [PATCH 1/2] io_uring: Move from hlist to io_wq_work_node
Date: Tue, 21 Feb 2023 16:53:27 -0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 2/21/23 11:38?AM, Breno Leitao wrote:
> Sure. I will remove the assignents in "if" part and maybe replicate what
> we have
> in io_alloc_cache_get(). Something as:
>        if (cache->list.next) {
>                node = cache->list.next;
> 
> Thanks for the review!

Pavel is right in that we generally discourage assignments in if
statements etc. For the above, the usual approach would be:

node = cache->list.next;
if (node) {
	...
}

-- 
Jens Axboe


      parent reply	other threads:[~2023-02-21 23:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21 13:57 [PATCH 1/2] io_uring: Move from hlist to io_wq_work_node Breno Leitao
2023-02-21 13:57 ` [PATCH 2/2] io_uring: Add KASAN support for alloc_caches Breno Leitao
2023-02-21 16:39   ` kernel test robot
2023-02-21 17:45 ` [PATCH 1/2] io_uring: Move from hlist to io_wq_work_node Pavel Begunkov
2023-02-21 18:38   ` Breno Leitao
2023-02-21 18:43     ` Pavel Begunkov
2023-02-21 23:53     ` Jens Axboe [this message]

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] \
    [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