linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: troy.kisky@boundarydevices.com (Troy Kisky)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] cpufreq: dbx500: Round to closest available freq
Date: Thu, 11 Apr 2013 14:52:39 -0700	[thread overview]
Message-ID: <516730A7.60206@boundarydevices.com> (raw)
In-Reply-To: <1512269.3ZuqNVLx3s@vostro.rjw.lan>

On 4/11/2013 2:33 PM, Rafael J. Wysocki wrote:
> On Thursday, April 11, 2013 10:33:07 PM Linus Walleij wrote:
>> On Wed, Apr 10, 2013 at 3:06 PM, Ulf Hansson <ulf.hansson@stericsson.com> wrote:
>>
>>> From: Mats Fagerstrom <mats.fagerstrom@stericsson.com>
>>>
>>> When reading the cpu speed, round it to the closest available
>>> frequency from the table.
>>>
>>> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
>>> Signed-off-by: Mats Fagerstrom <mats.fagerstrom@stericsson.com>
>> (...)
>>> +       /* The value is rounded to closest frequency in the defined table. */
>>> +       while (freq_table[i + 1].frequency != CPUFREQ_TABLE_END) {
>>> +               if (freq < freq_table[i].frequency +
>>> +                  (freq_table[i + 1].frequency - freq_table[i].frequency) / 2)

if (freq < (freq_table[i].frequency + freq_table[i + 1].frequency) / 2)

is easier to read.



>>>                          return freq_table[i].frequency;
>> Oh that works, clever.
>>
>> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> Thanks, applied.
>
> Rafael
>
>

      reply	other threads:[~2013-04-11 21:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-10 13:06 [PATCH] cpufreq: dbx500: Round to closest available freq Ulf Hansson
2013-04-11 20:33 ` Linus Walleij
2013-04-11 21:33   ` Rafael J. Wysocki
2013-04-11 21:52     ` Troy Kisky [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=516730A7.60206@boundarydevices.com \
    --to=troy.kisky@boundarydevices.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).