From: Niklas Cassel <Niklas.Cassel@wdc.com>
To: Christoph Hellwig <hch@lst.de>
Cc: "sagi@grimberg.me" <sagi@grimberg.me>,
"kbusch@kernel.org" <kbusch@kernel.org>,
"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Subject: Re: [PATCH] nvme: cleanup nvme_configure_apst
Date: Mon, 19 Apr 2021 07:32:22 +0000 [thread overview]
Message-ID: <YH0yBbPC5aRvF5pV@x1-carbon.lan> (raw)
In-Reply-To: <20210409094524.1920584-1-hch@lst.de>
On Fri, Apr 09, 2021 at 11:45:24AM +0200, Christoph Hellwig wrote:
> Remove a level of indentation from the main code implementating the table
> search by using a goto for the APST not supported case. Also move the
> main comment above the function.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/nvme/host/core.c | 148 ++++++++++++++++++---------------------
> 1 file changed, 69 insertions(+), 79 deletions(-)
>
(snip)
> + /*
> + * This state is good. Use it as the APST idle target for
> + * higher power states.
> + */
> + transition_ms = total_latency_us + 19;
> + do_div(transition_ms, 20);
> + if (transition_ms > (1 << 24) - 1)
> + transition_ms = (1 << 24) - 1;
> +
> + target = cpu_to_le64((state << 3) | (transition_ms << 8));
> + if (max_ps == -1)
> + max_ps = state;
> + if (total_latency_us > max_lat_us)
> + max_lat_us = total_latency_us;
> + }
>
First new line.
> - apste = 1;
>
Second new line.
> - if (max_ps == -1) {
> - dev_dbg(ctrl->device, "APST enabled but no non-operational states are available\n");
> - } else {
> - dev_dbg(ctrl->device, "APST enabled: max PS = %d, max round-trip latency = %lluus, table = %*phN\n",
> - max_ps, max_lat_us, (int)sizeof(*table), table);
> - }
> - }
> + if (max_ps == -1)
> + dev_dbg(ctrl->device, "APST enabled but no non-operational states are available\n");
> + else
> + dev_dbg(ctrl->device, "APST enabled: max PS = %d, max round-trip latency = %lluus, table = %*phN\n",
> + max_ps, max_lat_us, (int)sizeof(*table), table);
> + apste = 1;
>
> +done:
> ret = nvme_set_features(ctrl, NVME_FEAT_AUTO_PST, apste,
> table, sizeof(*table), NULL);
> if (ret)
> dev_err(ctrl->device, "failed to set APST feature (%d)\n", ret);
> -
> kfree(table);
> return ret;
> }
If you remove the second new line, such that there are not two succeeding
new lines:
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
prev parent reply other threads:[~2021-04-19 7:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-09 9:45 [PATCH] nvme: cleanup nvme_configure_apst Christoph Hellwig
2021-04-09 16:49 ` Niklas Cassel
2021-04-10 6:50 ` Christoph Hellwig
2021-04-19 7:07 ` Christoph Hellwig
2021-04-19 7:32 ` Niklas Cassel [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 \
--in-reply-to=YH0yBbPC5aRvF5pV@x1-carbon.lan \
--to=niklas.cassel@wdc.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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;
as well as URLs for NNTP newsgroup(s).