Commit 941e492bdb1239d2ca8f5736cdfd3ff83d00cb90

Authored by Andrew Morton
Committed by Linus Torvalds
1 parent 83bad1d764

read_current_timer() cleanups

- All implementations can be __devinit

- The function prototypes were in asm/timex.h but they all must be the same,
  so create a single declaration in linux/timex.h.

- uninline the sparc64 version to match the other architectures

- Don't bother #defining ARCH_HAS_READ_CURRENT_TIMER to a particular value.

[ezk@cs.sunysb.edu: fix build]
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 9 changed files with 20 additions and 14 deletions Side-by-side Diff

arch/avr32/lib/delay.c
... ... @@ -12,13 +12,15 @@
12 12  
13 13 #include <linux/delay.h>
14 14 #include <linux/module.h>
  15 +#include <linux/timex.h>
15 16 #include <linux/param.h>
16 17 #include <linux/types.h>
  18 +#include <linux/init.h>
17 19  
18 20 #include <asm/processor.h>
19 21 #include <asm/sysreg.h>
20 22  
21   -int read_current_timer(unsigned long *timer_value)
  23 +int __devinit read_current_timer(unsigned long *timer_value)
22 24 {
23 25 *timer_value = sysreg_read(COUNT);
24 26 return 0;
arch/sparc64/kernel/time.c
... ... @@ -1707,6 +1707,11 @@
1707 1707 misc_deregister(&rtc_mini_dev);
1708 1708 }
1709 1709  
  1710 +int __devinit read_current_timer(unsigned long *timer_val)
  1711 +{
  1712 + *timer_val = tick_ops->get_tick();
  1713 + return 0;
  1714 +}
1710 1715  
1711 1716 module_init(rtc_mini_init);
1712 1717 module_exit(rtc_mini_exit);
arch/x86/lib/delay_32.c
... ... @@ -12,8 +12,10 @@
12 12  
13 13 #include <linux/module.h>
14 14 #include <linux/sched.h>
  15 +#include <linux/timex.h>
15 16 #include <linux/preempt.h>
16 17 #include <linux/delay.h>
  18 +#include <linux/init.h>
17 19  
18 20 #include <asm/processor.h>
19 21 #include <asm/delay.h>
... ... @@ -63,7 +65,7 @@
63 65 delay_fn = delay_tsc;
64 66 }
65 67  
66   -int read_current_timer(unsigned long *timer_val)
  68 +int __devinit read_current_timer(unsigned long *timer_val)
67 69 {
68 70 if (delay_fn == delay_tsc) {
69 71 rdtscl(*timer_val);
arch/x86/lib/delay_64.c
... ... @@ -10,8 +10,10 @@
10 10  
11 11 #include <linux/module.h>
12 12 #include <linux/sched.h>
  13 +#include <linux/timex.h>
13 14 #include <linux/preempt.h>
14 15 #include <linux/delay.h>
  16 +#include <linux/init.h>
15 17  
16 18 #include <asm/delay.h>
17 19 #include <asm/msr.h>
... ... @@ -20,7 +22,7 @@
20 22 #include <asm/smp.h>
21 23 #endif
22 24  
23   -int read_current_timer(unsigned long *timer_value)
  25 +int __devinit read_current_timer(unsigned long *timer_value)
24 26 {
25 27 rdtscll(*timer_value);
26 28 return 0;
include/asm-avr32/timex.h
... ... @@ -34,8 +34,7 @@
34 34 return 0;
35 35 }
36 36  
37   -extern int read_current_timer(unsigned long *timer_value);
38   -#define ARCH_HAS_READ_CURRENT_TIMER 1
  37 +#define ARCH_HAS_READ_CURRENT_TIMER
39 38  
40 39 #endif /* __ASM_AVR32_TIMEX_H */
include/asm-sparc64/timex.h
... ... @@ -14,11 +14,7 @@
14 14 typedef unsigned long cycles_t;
15 15 #define get_cycles() tick_ops->get_tick()
16 16  
17   -#define ARCH_HAS_READ_CURRENT_TIMER 1
18   -#define read_current_timer(timer_val_p) \
19   -({ *timer_val_p = tick_ops->get_tick(); \
20   - 0; \
21   -})
  17 +#define ARCH_HAS_READ_CURRENT_TIMER
22 18  
23 19 #endif
include/asm-x86/timex.h
... ... @@ -14,8 +14,7 @@
14 14 #endif
15 15 #define CLOCK_TICK_RATE PIT_TICK_RATE
16 16  
17   -extern int read_current_timer(unsigned long *timer_value);
18   -#define ARCH_HAS_READ_CURRENT_TIMER 1
  17 +#define ARCH_HAS_READ_CURRENT_TIMER
19 18  
20 19 #endif
include/linux/timex.h
... ... @@ -244,6 +244,8 @@
244 244 /* Don't use! Compatibility define for existing users. */
245 245 #define tickadj (500/HZ ? : 1)
246 246  
  247 +int read_current_timer(unsigned long *timer_val);
  248 +
247 249 #endif /* KERNEL */
248 250  
249 251 #endif /* LINUX_TIMEX_H */
... ... @@ -7,8 +7,7 @@
7 7 #include <linux/jiffies.h>
8 8 #include <linux/delay.h>
9 9 #include <linux/init.h>
10   -
11   -#include <asm/timex.h>
  10 +#include <linux/timex.h>
12 11  
13 12 unsigned long preset_lpj;
14 13 static int __init lpj_setup(char *str)