From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: dirk.brandewie@gmail.com
Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
Dirk Brandewie <dirk.j.brandewie@intel.com>
Subject: Re: [PATCH 3/5] intel_pstate: Fix fixed point rounding macro
Date: Mon, 12 May 2014 14:17:43 +0200 [thread overview]
Message-ID: <10396519.O9MHslF7EE@vostro.rjw.lan> (raw)
In-Reply-To: <1399579047-5792-4-git-send-email-dirk.j.brandewie@intel.com>
On Thursday, May 08, 2014 12:57:25 PM dirk.brandewie@gmail.com wrote:
> From: Dirk Brandewie <dirk.j.brandewie@intel.com>
>
> Change the FP_ROUNDUP macro to add 0.5 in fixed point representation
> instead of 1.0
It would be good to say why exactly it is a problem too. I guess it overflows
sometimes, right?
> Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
> ---
> drivers/cpufreq/intel_pstate.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> index eab8ccf..bb20881 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -43,7 +43,7 @@
> #define FRAC_BITS 6
> #define int_tofp(X) ((int64_t)(X) << FRAC_BITS)
> #define fp_toint(X) ((X) >> FRAC_BITS)
> -#define FP_ROUNDUP(X) ((X) += 1 << FRAC_BITS)
> +#define FP_ROUNDUP(X) ((X) += 1 << (FRAC_BITS-1))
>
> static inline int32_t mul_fp(int32_t x, int32_t y)
> {
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
next prev parent reply other threads:[~2014-05-12 12:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-08 19:57 [PATCH 0/5] updates for intel_pstate dirk.brandewie
2014-05-08 19:57 ` [PATCH 2/5] intel_pstate: remove setting P state to MAX on init dirk.brandewie
2014-05-08 19:57 ` [PATCH 3/5] intel_pstate: Fix fixed point rounding macro dirk.brandewie
2014-05-12 12:17 ` Rafael J. Wysocki [this message]
2014-05-08 19:57 ` [PATCH 4/5] intel_pstate: Remove C0 tracking dirk.brandewie
2014-05-09 1:44 ` Yuyang Du
2014-05-12 0:26 ` Rafael J. Wysocki
[not found] ` <CADmjqpOnzRrB8gJsmHWG=4bvhERLovnKyP0Pcki_uVJ3qpfD0g@mail.gmail.com>
2014-05-12 2:27 ` Stratos Karafotis
2014-05-12 12:16 ` Rafael J. Wysocki
2014-05-12 14:39 ` Dirk Brandewie
2014-05-12 23:45 ` Rafael J. Wysocki
2014-05-08 19:57 ` [PATCH 5/5] intel_pstate: Add CPU IDs for Broadwell processors dirk.brandewie
2014-05-08 20:30 ` [PATCH 0/5] updates for intel_pstate Rafael J. Wysocki
2014-05-08 21:08 ` Dirk Brandewie
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=10396519.O9MHslF7EE@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=dirk.brandewie@gmail.com \
--cc=dirk.j.brandewie@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.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).