From: Rik van Riel Subject: Re: Re: [PATCH RFC] do_settime is backwards?! Date: Wed, 6 Aug 2008 18:28:35 -0400 Message-ID: <20080806182835.0ce8adb7@bree.surriel.com> References: <20080806174705.5b2a64b6@cuia.bos.redhat.com> <20080806155102421.00000008444@djm-pc> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20080806155102421.00000008444@djm-pc> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "dan.magenheimer@oracle.com" Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Wed, 6 Aug 2008 15:51:02 -0600 "Dan Magenheimer" wrote: > Check out the definition of do_div which works strangely. > I was confused by that also, but the code in question > does work (I think!). OK, so the original code of: x = (secs * 1000000000ULL) + (u64)nsecs - system_time_base; y = do_div(x, 1000000000); Leaves "x" as the number of seconds and "y" as the remainder, in nanoseconds. Good to know that I overlooked something and the original code was right after all! -- All rights reversed.