lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <10396519.O9MHslF7EE@vostro.rjw.lan>
Date:	Mon, 12 May 2014 14:17:43 +0200
From:	"Rafael J. Wysocki" <rjw@...ysocki.net>
To:	dirk.brandewie@...il.com
Cc:	linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
	Dirk Brandewie <dirk.j.brandewie@...el.com>
Subject: Re: [PATCH 3/5] intel_pstate: Fix fixed point rounding macro

On Thursday, May 08, 2014 12:57:25 PM dirk.brandewie@...il.com wrote:
> From: Dirk Brandewie <dirk.j.brandewie@...el.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@...el.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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ