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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161208234022.GL13139@umbus.fritz.box>
Date:   Fri, 9 Dec 2016 10:40:22 +1100
From:   David Gibson <david@...son.dropbear.id.au>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        John Stultz <john.stultz@...aro.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...nel.org>,
        Liav Rehana <liavr@...lanox.com>,
        Chris Metcalf <cmetcalf@...lanox.com>,
        Richard Cochran <richardcochran@...il.com>,
        Parit Bhargava <prarit@...hat.com>,
        Laurent Vivier <lvivier@...hat.com>,
        "Christopher S. Hall" <christopher.s.hall@...el.com>
Subject: Re: [patch 3/6] timekeeping: Get rid of pointless typecasts

On Thu, Dec 08, 2016 at 08:49:36PM -0000, Thomas Gleixner wrote:
> cycles_t is defined as u64, so casting it to u64 is a pointless and
> confusing exercise. cycles_t should simply go away and be replaced with a
> plain u64 to avoid further confusion.
> 
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>

Reviewed-by: David Gibson <david@...son.dropbear.id.au>

> ---
>  kernel/time/timekeeping.c |    5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> --- a/kernel/time/timekeeping.c
> +++ b/kernel/time/timekeeping.c
> @@ -258,10 +258,9 @@ static void tk_setup_internals(struct ti
>  	tk->cycle_interval = interval;
>  
>  	/* Go back from cycles -> shifted ns */
> -	tk->xtime_interval = (u64) interval * clock->mult;
> +	tk->xtime_interval = interval * clock->mult;
>  	tk->xtime_remainder = ntpinterval - tk->xtime_interval;
> -	tk->raw_interval =
> -		((u64) interval * clock->mult) >> clock->shift;
> +	tk->raw_interval = (interval * clock->mult) >> clock->shift;
>  
>  	 /* if changing clocks, convert xtime_nsec shift units */
>  	if (old_clock) {
> 
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ