mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: john stultz <johnstul@us.ibm.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
	ak@suse.de, Andrew Morton <akpm@digeo.com>
Subject: [PATCH] linux-2.5.63_x86-tsc-cleanup_A0
Date: 24 Feb 2003 21:10:49 -0800	[thread overview]
Message-ID: <1046149849.18311.348.camel@w-jstultz2.beaverton.ibm.com> (raw)
In-Reply-To: <1046149232.18311.337.camel@w-jstultz2.beaverton.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 848 bytes --]

Linus, All,
	As promised, here is a minor cleanup that removes the usage of
CONFIG_X86_TSC in get_cycles(), replacing it with a runtime conditional
of if(cpu_has_tsc).

Andi: I've already posted this a few times without complaint, but since
you didn't like my playing with get_cycles() last time, let me know if
have any issues with this.

thanks
-john


diff -Nru a/include/asm-i386/timex.h b/include/asm-i386/timex.h
--- a/include/asm-i386/timex.h	Mon Feb 24 21:09:32 2003
+++ b/include/asm-i386/timex.h	Mon Feb 24 21:09:32 2003
@@ -40,14 +40,10 @@
 
 static inline cycles_t get_cycles (void)
 {
-#ifndef CONFIG_X86_TSC
-	return 0;
-#else
-	unsigned long long ret;
-
-	rdtscll(ret);
+	unsigned long long ret = 0;
+	if(cpu_has_tsc)
+		rdtscll(ret);
 	return ret;
-#endif
 }
 
 extern unsigned long cpu_khz;




[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 232 bytes --]

      reply	other threads:[~2003-02-25  5:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-25  5:00 [PATCH] linux-2.5.63_notsc-panic_A1 john stultz
2003-02-25  5:10 ` john stultz [this message]

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=1046149849.18311.348.camel@w-jstultz2.beaverton.ibm.com \
    --to=johnstul@us.ibm.com \
    --cc=ak@suse.de \
    --cc=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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

all inboxes | Powered by JetHome®