mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: David Howells <dhowells@redhat.com>,
	John Stultz <johnstul@us.ibm.com>,
	Koichi Yasutake <yasutake.koichi@jp.panasonic.com>,
	Mark Salter <msalter@redhat.com>
Subject: [patch 2/3] mn10300: Use clocksource_register_hz()
Date: Mon, 31 Jan 2011 13:19:54 -0000	[thread overview]
Message-ID: <20110131131808.916682507@linutronix.de> (raw)
In-Reply-To: <20110131131707.795836437@linutronix.de>

[-- Attachment #1: mn10300-use-clocksource-register-hz.patch --]
[-- Type: text/plain, Size: 2248 bytes --]

clocksource_register_hz() calculates the shift/mult pair for the
clocksource. Remove the mn10300 duplicate implementation.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
Cc: Mark Salter <msalter@redhat.com>
---
 arch/mn10300/kernel/csrc-mn10300.c |    3 +--
 arch/mn10300/kernel/internal.h     |    3 ---
 arch/mn10300/kernel/time.c         |   16 ----------------
 3 files changed, 1 insertion(+), 21 deletions(-)

Index: linux-2.6/arch/mn10300/kernel/csrc-mn10300.c
===================================================================
--- linux-2.6.orig/arch/mn10300/kernel/csrc-mn10300.c
+++ linux-2.6/arch/mn10300/kernel/csrc-mn10300.c
@@ -29,7 +29,6 @@ static struct clocksource clocksource_mn
 int __init init_clocksource(void)
 {
 	startup_timestamp_counter();
-	clocksource_set_clock(&clocksource_mn10300, MN10300_TSCCLK);
-	clocksource_register(&clocksource_mn10300);
+	clocksource_register_hz(&clocksource_mn10300, MN10300_TSCCLK);
 	return 0;
 }
Index: linux-2.6/arch/mn10300/kernel/internal.h
===================================================================
--- linux-2.6.orig/arch/mn10300/kernel/internal.h
+++ linux-2.6/arch/mn10300/kernel/internal.h
@@ -37,9 +37,6 @@ extern irqreturn_t local_timer_interrupt
 /*
  * time.c
  */
-#ifdef CONFIG_CEVT_MN10300
-extern void clockevent_set_clock(struct clock_event_device *, unsigned int);
-#endif
 #ifdef CONFIG_CSRC_MN10300
 extern void clocksource_set_clock(struct clocksource *, unsigned int);
 #endif
Index: linux-2.6/arch/mn10300/kernel/time.c
===================================================================
--- linux-2.6.orig/arch/mn10300/kernel/time.c
+++ linux-2.6/arch/mn10300/kernel/time.c
@@ -93,22 +93,6 @@ irqreturn_t local_timer_interrupt(void)
 	return IRQ_HANDLED;
 }
 
-void __init clocksource_set_clock(struct clocksource *cs, unsigned int clock)
-{
-	u64 temp;
-	u32 shift;
-
-	/* Find a shift value */
-	for (shift = 32; shift > 0; shift--) {
-		temp = (u64) NSEC_PER_SEC << shift;
-		do_div(temp, clock);
-		if ((temp >> 32) == 0)
-			break;
-	}
-	cs->shift = shift;
-	cs->mult = (u32) temp;
-}
-
 void __cpuinit clockevent_set_clock(struct clock_event_device *cd,
 				    unsigned int clock)
 {



  parent reply	other threads:[~2011-01-31 13:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-31 13:19 [patch 0/3] mn10300: Cleanup time and timer related code Thomas Gleixner
2011-01-31 13:19 ` [patch 1/3] mn10300: Remove stale code Thomas Gleixner
2011-01-31 13:28   ` Thomas Gleixner
2011-02-01 22:18   ` john stultz
2011-01-31 13:19 ` Thomas Gleixner [this message]
2011-02-01 22:19   ` [patch 2/3] mn10300: Use clocksource_register_hz() john stultz
2011-01-31 13:19 ` [patch 3/3] mn10300: Use clockevents_calc_mult_shift() Thomas Gleixner
2011-02-01 22:20   ` john stultz

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=20110131131808.916682507@linutronix.de \
    --to=tglx@linutronix.de \
    --cc=dhowells@redhat.com \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=msalter@redhat.com \
    --cc=yasutake.koichi@jp.panasonic.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®