From: Christoph Hellwig <hch@lst.de>
To: Jinlong Chen <nickyc975@zju.edu.cn>
Cc: axboe@kernel.dk, hch@lst.de, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] elevator: replace continue with else-if in elv_iosched_show
Date: Tue, 29 Nov 2022 09:33:06 +0100 [thread overview]
Message-ID: <20221129083306.GB24762@lst.de> (raw)
In-Reply-To: <852b18c086ef08baec99d08479a3558a3d5db70f.1669391142.git.nickyc975@zju.edu.cn>
On Fri, Nov 25, 2022 at 11:53:12PM +0800, Jinlong Chen wrote:
> list_for_each_entry(e, &elv_list, list) {
> - if (e == cur) {
> + if (e == cur)
> len += sprintf(name+len, "[%s] ", cur->elevator_name);
> - continue;
> - }
> - if (elv_support_features(q, e))
> + else if (elv_support_features(q, e))
> len += sprintf(name+len, "%s ", e->elevator_name);
Looks good. But to make this even more obvious I'd also switch to
pinting e->elevator_name for the cur case instead of cur.
next prev parent reply other threads:[~2022-11-29 8:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-25 15:53 [PATCH 0/4] random improvements and cleanups for elevator.c Jinlong Chen
2022-11-25 15:53 ` [PATCH 1/4] elevator: print none at first in elv_iosched_show even if the queue has a scheduler Jinlong Chen
2022-11-29 8:30 ` Christoph Hellwig
2022-11-25 15:53 ` [PATCH 2/4] elevator: replace continue with else-if in elv_iosched_show Jinlong Chen
2022-11-29 8:33 ` Christoph Hellwig [this message]
2022-11-29 10:51 ` Jinlong Chen
2022-11-25 15:53 ` [PATCH 3/4] elevator: repalce "len+name" with "name+len" " Jinlong Chen
2022-11-29 8:33 ` Christoph Hellwig
2022-11-25 15:53 ` [PATCH 4/4] elevator: use bool instead of int as the return type of elv_iosched_allow_bio_merge Jinlong Chen
2022-11-29 8:34 ` Christoph Hellwig
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=20221129083306.GB24762@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nickyc975@zju.edu.cn \
/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