All of lore.kernel.org
 help / color / mirror / Atom feed
From: luto@amacapital.net (Andy Lutomirski)
Subject: [PATCH v2 2/2] nvme: Enable autonomous power state transitions
Date: Thu, 19 Jan 2017 21:17:09 -0800	[thread overview]
Message-ID: <CALCETrUaHmvrSrDHL5ysri+dXZq8iqGWzJdusVxPMxdsuieZhQ@mail.gmail.com> (raw)
In-Reply-To: <20170119201530.GA31954@localhost.localdomain>

On Thu, Jan 19, 2017@12:15 PM, Keith Busch <keith.busch@intel.com> wrote:
> On Thu, Jan 19, 2017@11:55:44AM -0800, Andy Lutomirski wrote:
>> +static void nvme_set_latency_tolerance(struct device *dev, s32 val)
>> +{
>> +     struct nvme_ctrl *ctrl = dev_get_drvdata(dev);
>> +
>> +     u64 latency;
>> +
>> +     if (val == PM_QOS_LATENCY_TOLERANCE_NO_CONSTRAINT ||
>> +         val == PM_QOS_LATENCY_ANY)
>> +             latency = U64_MAX;
>> +     else
>> +             latency = val;
>> +
>> +     if (ctrl->ps_max_latency_us != val) {
>> +             ctrl->ps_max_latency_us = val;
>
> Did you mean to use 'latency' here instead of 'val'? Otherwise, I don't
> see why the latency variable exists.

D'oh!  I'm a bit surprised the compiler didn't warn.

As a practical matter, this probably had no effect in my testing
because the two magic values would have ended up being rather large
s32 values, so the effect would be the same.  v3 coming, though.

  reply	other threads:[~2017-01-20  5:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-19 19:55 [PATCH v2 0/2] nvme: APST support Andy Lutomirski
2017-01-19 19:55 ` [PATCH v2 1/2] nvme: Add a quirk mechanism that uses identify_ctrl Andy Lutomirski
2017-01-20 10:24   ` Christoph Hellwig
2017-01-19 19:55 ` [PATCH v2 2/2] nvme: Enable autonomous power state transitions Andy Lutomirski
2017-01-19 20:15   ` Keith Busch
2017-01-20  5:17     ` Andy Lutomirski [this message]
2017-01-20 10:30   ` Christoph Hellwig
2017-01-20 18:07     ` Andy Lutomirski

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=CALCETrUaHmvrSrDHL5ysri+dXZq8iqGWzJdusVxPMxdsuieZhQ@mail.gmail.com \
    --to=luto@amacapital.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.