diff options
author | Daniel Walker <dwalker@mvista.com> | 2006-12-10 05:21:33 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-10 12:57:22 -0500 |
commit | f5f1a24a2caa299bb7d294aee92d7dd3410d9ed7 (patch) | |
tree | 499a2687c2e29733974d1721d238c561078b46c5 | |
parent | 2b0137001de68153203dd3bc20e6d27eb7c9719c (diff) |
[PATCH] clocksource: small cleanup
Mostly changing alignment. Just some general cleanup.
[akpm@osdl.org: build fix]
Signed-off-by: Daniel Walker <dwalker@mvista.com>
Acked-by: John Stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | drivers/clocksource/acpi_pm.c | 6 | ||||
-rw-r--r-- | include/linux/clocksource.h | 2 | ||||
-rw-r--r-- | kernel/time/clocksource.c | 6 | ||||
-rw-r--r-- | kernel/timer.c | 16 |
4 files changed, 18 insertions, 12 deletions
diff --git a/drivers/clocksource/acpi_pm.c b/drivers/clocksource/acpi_pm.c index 8ab61ef97b4c..b6bcdbbf57b3 100644 --- a/drivers/clocksource/acpi_pm.c +++ b/drivers/clocksource/acpi_pm.c | |||
@@ -77,11 +77,11 @@ static struct clocksource clocksource_acpi_pm = { | |||
77 | 77 | ||
78 | 78 | ||
79 | #ifdef CONFIG_PCI | 79 | #ifdef CONFIG_PCI |
80 | static int acpi_pm_good; | 80 | static int __devinitdata acpi_pm_good; |
81 | static int __init acpi_pm_good_setup(char *__str) | 81 | static int __init acpi_pm_good_setup(char *__str) |
82 | { | 82 | { |
83 | acpi_pm_good = 1; | 83 | acpi_pm_good = 1; |
84 | return 1; | 84 | return 1; |
85 | } | 85 | } |
86 | __setup("acpi_pm_good", acpi_pm_good_setup); | 86 | __setup("acpi_pm_good", acpi_pm_good_setup); |
87 | 87 | ||
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index d852024ed095..1622d23a8dc3 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -159,7 +159,7 @@ static inline s64 cyc2ns(struct clocksource *cs, cycle_t cycles) | |||
159 | * Unless you're the timekeeping code, you should not be using this! | 159 | * Unless you're the timekeeping code, you should not be using this! |
160 | */ | 160 | */ |
161 | static inline void clocksource_calculate_interval(struct clocksource *c, | 161 | static inline void clocksource_calculate_interval(struct clocksource *c, |
162 | unsigned long length_nsec) | 162 | unsigned long length_nsec) |
163 | { | 163 | { |
164 | u64 tmp; | 164 | u64 tmp; |
165 | 165 | ||
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index 3651b34cc355..22504afc0d34 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c | |||
@@ -156,7 +156,7 @@ int clocksource_register(struct clocksource *c) | |||
156 | /* check if clocksource is already registered */ | 156 | /* check if clocksource is already registered */ |
157 | if (is_registered_source(c)) { | 157 | if (is_registered_source(c)) { |
158 | printk("register_clocksource: Cannot register %s. " | 158 | printk("register_clocksource: Cannot register %s. " |
159 | "Already registered!", c->name); | 159 | "Already registered!", c->name); |
160 | ret = -EBUSY; | 160 | ret = -EBUSY; |
161 | } else { | 161 | } else { |
162 | /* register it */ | 162 | /* register it */ |
@@ -276,10 +276,10 @@ sysfs_show_available_clocksources(struct sys_device *dev, char *buf) | |||
276 | * Sysfs setup bits: | 276 | * Sysfs setup bits: |
277 | */ | 277 | */ |
278 | static SYSDEV_ATTR(current_clocksource, 0600, sysfs_show_current_clocksources, | 278 | static SYSDEV_ATTR(current_clocksource, 0600, sysfs_show_current_clocksources, |
279 | sysfs_override_clocksource); | 279 | sysfs_override_clocksource); |
280 | 280 | ||
281 | static SYSDEV_ATTR(available_clocksource, 0600, | 281 | static SYSDEV_ATTR(available_clocksource, 0600, |
282 | sysfs_show_available_clocksources, NULL); | 282 | sysfs_show_available_clocksources, NULL); |
283 | 283 | ||
284 | static struct sysdev_class clocksource_sysclass = { | 284 | static struct sysdev_class clocksource_sysclass = { |
285 | set_kset_name("clocksource"), | 285 | set_kset_name("clocksource"), |
diff --git a/kernel/timer.c b/kernel/timer.c index b1f40f256eb0..0256ab443d8a 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -846,7 +846,7 @@ static int change_clocksource(void) | |||
846 | clock = new; | 846 | clock = new; |
847 | clock->cycle_last = now; | 847 | clock->cycle_last = now; |
848 | printk(KERN_INFO "Time: %s clocksource has been installed.\n", | 848 | printk(KERN_INFO "Time: %s clocksource has been installed.\n", |
849 | clock->name); | 849 | clock->name); |
850 | return 1; | 850 | return 1; |
851 | } else if (clock->update_callback) { | 851 | } else if (clock->update_callback) { |
852 | return clock->update_callback(); | 852 | return clock->update_callback(); |
@@ -854,7 +854,10 @@ static int change_clocksource(void) | |||
854 | return 0; | 854 | return 0; |
855 | } | 855 | } |
856 | #else | 856 | #else |
857 | #define change_clocksource() (0) | 857 | static inline int change_clocksource(void) |
858 | { | ||
859 | return 0; | ||
860 | } | ||
858 | #endif | 861 | #endif |
859 | 862 | ||
860 | /** | 863 | /** |
@@ -952,7 +955,8 @@ device_initcall(timekeeping_init_device); | |||
952 | * If the error is already larger, we look ahead even further | 955 | * If the error is already larger, we look ahead even further |
953 | * to compensate for late or lost adjustments. | 956 | * to compensate for late or lost adjustments. |
954 | */ | 957 | */ |
955 | static __always_inline int clocksource_bigadjust(s64 error, s64 *interval, s64 *offset) | 958 | static __always_inline int clocksource_bigadjust(s64 error, s64 *interval, |
959 | s64 *offset) | ||
956 | { | 960 | { |
957 | s64 tick_error, i; | 961 | s64 tick_error, i; |
958 | u32 look_ahead, adj; | 962 | u32 look_ahead, adj; |
@@ -976,7 +980,8 @@ static __always_inline int clocksource_bigadjust(s64 error, s64 *interval, s64 * | |||
976 | * Now calculate the error in (1 << look_ahead) ticks, but first | 980 | * Now calculate the error in (1 << look_ahead) ticks, but first |
977 | * remove the single look ahead already included in the error. | 981 | * remove the single look ahead already included in the error. |
978 | */ | 982 | */ |
979 | tick_error = current_tick_length() >> (TICK_LENGTH_SHIFT - clock->shift + 1); | 983 | tick_error = current_tick_length() >> |
984 | (TICK_LENGTH_SHIFT - clock->shift + 1); | ||
980 | tick_error -= clock->xtime_interval >> 1; | 985 | tick_error -= clock->xtime_interval >> 1; |
981 | error = ((error - tick_error) >> look_ahead) + tick_error; | 986 | error = ((error - tick_error) >> look_ahead) + tick_error; |
982 | 987 | ||
@@ -1028,7 +1033,8 @@ static void clocksource_adjust(struct clocksource *clock, s64 offset) | |||
1028 | clock->mult += adj; | 1033 | clock->mult += adj; |
1029 | clock->xtime_interval += interval; | 1034 | clock->xtime_interval += interval; |
1030 | clock->xtime_nsec -= offset; | 1035 | clock->xtime_nsec -= offset; |
1031 | clock->error -= (interval - offset) << (TICK_LENGTH_SHIFT - clock->shift); | 1036 | clock->error -= (interval - offset) << |
1037 | (TICK_LENGTH_SHIFT - clock->shift); | ||
1032 | } | 1038 | } |
1033 | 1039 | ||
1034 | /** | 1040 | /** |