public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alok Kataria <akataria@vmware.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: the arch/x86 maintainers <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Zach Amsden <zach@vmware.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: x86, vmi: TSC going backwards check in vmi clocksource
Date: Fri, 20 Feb 2009 10:23:18 -0800	[thread overview]
Message-ID: <1235154198.1547.3.camel@alok-dev1> (raw)
In-Reply-To: <20090220175841.GQ24538@elte.hu>

On Fri, 2009-02-20 at 09:58 -0800, Ingo Molnar wrote:
> * Alok Kataria <akataria@vmware.com> wrote:
> 
> >  static cycle_t read_real_cycles(void)
> >  {
> > -	return vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL);
> > +	cycle_t ret = (cycle_t)vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL);
> > +	return ret >= clocksource_vmi.cycle_last ?
> > +		ret : clocksource_vmi.cycle_last;
> 
> btw., could you please clean this up to use max()?

Please find it below, on top of current tip/master.

--

cleanup vmi_read_cycles to use max()

Signed-off-by: Alok N Kataria <akataria@vmware.com>

---

 arch/x86/kernel/vmiclock_32.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)


diff --git a/arch/x86/kernel/vmiclock_32.c b/arch/x86/kernel/vmiclock_32.c
index 9cd28c0..b77ad57 100644
--- a/arch/x86/kernel/vmiclock_32.c
+++ b/arch/x86/kernel/vmiclock_32.c
@@ -288,8 +288,7 @@ static struct clocksource clocksource_vmi;
 static cycle_t read_real_cycles(void)
 {
 	cycle_t ret = (cycle_t)vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL);
-	return ret >= clocksource_vmi.cycle_last ?
-		ret : clocksource_vmi.cycle_last;
+	return max(ret, clocksource_vmi.cycle_last);
 }
 
 static struct clocksource clocksource_vmi = {



  reply	other threads:[~2009-02-20 18:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-18 20:33 x86, vmi: TSC going backwards check in vmi clocksource Alok Kataria
2009-02-19 11:18 ` Ingo Molnar
2009-02-19 18:03   ` Alok Kataria
2009-02-19 18:11     ` Ingo Molnar
2009-02-20 17:58 ` Ingo Molnar
2009-02-20 18:23   ` Alok Kataria [this message]
2009-02-20 18:31     ` Ingo Molnar

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=1235154198.1547.3.camel@alok-dev1 \
    --to=akataria@vmware.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=x86@kernel.org \
    --cc=zach@vmware.com \
    /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