提交 a6fa8e5a 编写于 作者: P Pavel Machek 提交者: Ingo Molnar

time: clean hungarian notation from timers

Clean up hungarian notation from timer code.
Signed-off-by: NPavel Machek <pavel@suse.cz>
Cc: john stultz <johnstul@us.ibm.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 213eca7f
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <linux/ktime.h> #include <linux/ktime.h>
#include <linux/stddef.h> #include <linux/stddef.h>
struct tvec_t_base_s; struct tvec_base;
struct timer_list { struct timer_list {
struct list_head entry; struct list_head entry;
...@@ -14,7 +14,7 @@ struct timer_list { ...@@ -14,7 +14,7 @@ struct timer_list {
void (*function)(unsigned long); void (*function)(unsigned long);
unsigned long data; unsigned long data;
struct tvec_t_base_s *base; struct tvec_base *base;
#ifdef CONFIG_TIMER_STATS #ifdef CONFIG_TIMER_STATS
void *start_site; void *start_site;
char start_comm[16]; char start_comm[16];
...@@ -22,7 +22,7 @@ struct timer_list { ...@@ -22,7 +22,7 @@ struct timer_list {
#endif #endif
}; };
extern struct tvec_t_base_s boot_tvec_bases; extern struct tvec_base boot_tvec_bases;
#define TIMER_INITIALIZER(_function, _expires, _data) { \ #define TIMER_INITIALIZER(_function, _expires, _data) { \
.function = (_function), \ .function = (_function), \
......
...@@ -58,59 +58,57 @@ EXPORT_SYMBOL(jiffies_64); ...@@ -58,59 +58,57 @@ EXPORT_SYMBOL(jiffies_64);
#define TVN_MASK (TVN_SIZE - 1) #define TVN_MASK (TVN_SIZE - 1)
#define TVR_MASK (TVR_SIZE - 1) #define TVR_MASK (TVR_SIZE - 1)
typedef struct tvec_s { struct tvec {
struct list_head vec[TVN_SIZE]; struct list_head vec[TVN_SIZE];
} tvec_t; };
typedef struct tvec_root_s { struct tvec_root {
struct list_head vec[TVR_SIZE]; struct list_head vec[TVR_SIZE];
} tvec_root_t; };
struct tvec_t_base_s { struct tvec_base {
spinlock_t lock; spinlock_t lock;
struct timer_list *running_timer; struct timer_list *running_timer;
unsigned long timer_jiffies; unsigned long timer_jiffies;
tvec_root_t tv1; struct tvec_root tv1;
tvec_t tv2; struct tvec tv2;
tvec_t tv3; struct tvec tv3;
tvec_t tv4; struct tvec tv4;
tvec_t tv5; struct tvec tv5;
} ____cacheline_aligned; } ____cacheline_aligned;
typedef struct tvec_t_base_s tvec_base_t; struct tvec_base boot_tvec_bases;
tvec_base_t boot_tvec_bases;
EXPORT_SYMBOL(boot_tvec_bases); EXPORT_SYMBOL(boot_tvec_bases);
static DEFINE_PER_CPU(tvec_base_t *, tvec_bases) = &boot_tvec_bases; static DEFINE_PER_CPU(struct tvec_base *, tvec_bases) = &boot_tvec_bases;
/* /*
* Note that all tvec_bases is 2 byte aligned and lower bit of * Note that all tvec_bases are 2 byte aligned and lower bit of
* base in timer_list is guaranteed to be zero. Use the LSB for * base in timer_list is guaranteed to be zero. Use the LSB for
* the new flag to indicate whether the timer is deferrable * the new flag to indicate whether the timer is deferrable
*/ */
#define TBASE_DEFERRABLE_FLAG (0x1) #define TBASE_DEFERRABLE_FLAG (0x1)
/* Functions below help us manage 'deferrable' flag */ /* Functions below help us manage 'deferrable' flag */
static inline unsigned int tbase_get_deferrable(tvec_base_t *base) static inline unsigned int tbase_get_deferrable(struct tvec_base *base)
{ {
return ((unsigned int)(unsigned long)base & TBASE_DEFERRABLE_FLAG); return ((unsigned int)(unsigned long)base & TBASE_DEFERRABLE_FLAG);
} }
static inline tvec_base_t *tbase_get_base(tvec_base_t *base) static inline struct tvec_base *tbase_get_base(struct tvec_base *base)
{ {
return ((tvec_base_t *)((unsigned long)base & ~TBASE_DEFERRABLE_FLAG)); return ((struct tvec_base *)((unsigned long)base & ~TBASE_DEFERRABLE_FLAG));
} }
static inline void timer_set_deferrable(struct timer_list *timer) static inline void timer_set_deferrable(struct timer_list *timer)
{ {
timer->base = ((tvec_base_t *)((unsigned long)(timer->base) | timer->base = ((struct tvec_base *)((unsigned long)(timer->base) |
TBASE_DEFERRABLE_FLAG)); TBASE_DEFERRABLE_FLAG));
} }
static inline void static inline void
timer_set_base(struct timer_list *timer, tvec_base_t *new_base) timer_set_base(struct timer_list *timer, struct tvec_base *new_base)
{ {
timer->base = (tvec_base_t *)((unsigned long)(new_base) | timer->base = (struct tvec_base *)((unsigned long)(new_base) |
tbase_get_deferrable(timer->base)); tbase_get_deferrable(timer->base));
} }
...@@ -246,7 +244,7 @@ unsigned long round_jiffies_relative(unsigned long j) ...@@ -246,7 +244,7 @@ unsigned long round_jiffies_relative(unsigned long j)
EXPORT_SYMBOL_GPL(round_jiffies_relative); EXPORT_SYMBOL_GPL(round_jiffies_relative);
static inline void set_running_timer(tvec_base_t *base, static inline void set_running_timer(struct tvec_base *base,
struct timer_list *timer) struct timer_list *timer)
{ {
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
...@@ -254,7 +252,7 @@ static inline void set_running_timer(tvec_base_t *base, ...@@ -254,7 +252,7 @@ static inline void set_running_timer(tvec_base_t *base,
#endif #endif
} }
static void internal_add_timer(tvec_base_t *base, struct timer_list *timer) static void internal_add_timer(struct tvec_base *base, struct timer_list *timer)
{ {
unsigned long expires = timer->expires; unsigned long expires = timer->expires;
unsigned long idx = expires - base->timer_jiffies; unsigned long idx = expires - base->timer_jiffies;
...@@ -371,14 +369,14 @@ static inline void detach_timer(struct timer_list *timer, ...@@ -371,14 +369,14 @@ static inline void detach_timer(struct timer_list *timer,
* possible to set timer->base = NULL and drop the lock: the timer remains * possible to set timer->base = NULL and drop the lock: the timer remains
* locked. * locked.
*/ */
static tvec_base_t *lock_timer_base(struct timer_list *timer, static struct tvec_base *lock_timer_base(struct timer_list *timer,
unsigned long *flags) unsigned long *flags)
__acquires(timer->base->lock) __acquires(timer->base->lock)
{ {
tvec_base_t *base; struct tvec_base *base;
for (;;) { for (;;) {
tvec_base_t *prelock_base = timer->base; struct tvec_base *prelock_base = timer->base;
base = tbase_get_base(prelock_base); base = tbase_get_base(prelock_base);
if (likely(base != NULL)) { if (likely(base != NULL)) {
spin_lock_irqsave(&base->lock, *flags); spin_lock_irqsave(&base->lock, *flags);
...@@ -393,7 +391,7 @@ static tvec_base_t *lock_timer_base(struct timer_list *timer, ...@@ -393,7 +391,7 @@ static tvec_base_t *lock_timer_base(struct timer_list *timer,
int __mod_timer(struct timer_list *timer, unsigned long expires) int __mod_timer(struct timer_list *timer, unsigned long expires)
{ {
tvec_base_t *base, *new_base; struct tvec_base *base, *new_base;
unsigned long flags; unsigned long flags;
int ret = 0; int ret = 0;
...@@ -445,7 +443,7 @@ EXPORT_SYMBOL(__mod_timer); ...@@ -445,7 +443,7 @@ EXPORT_SYMBOL(__mod_timer);
*/ */
void add_timer_on(struct timer_list *timer, int cpu) void add_timer_on(struct timer_list *timer, int cpu)
{ {
tvec_base_t *base = per_cpu(tvec_bases, cpu); struct tvec_base *base = per_cpu(tvec_bases, cpu);
unsigned long flags; unsigned long flags;
timer_stats_timer_set_start_info(timer); timer_stats_timer_set_start_info(timer);
...@@ -508,7 +506,7 @@ EXPORT_SYMBOL(mod_timer); ...@@ -508,7 +506,7 @@ EXPORT_SYMBOL(mod_timer);
*/ */
int del_timer(struct timer_list *timer) int del_timer(struct timer_list *timer)
{ {
tvec_base_t *base; struct tvec_base *base;
unsigned long flags; unsigned long flags;
int ret = 0; int ret = 0;
...@@ -539,7 +537,7 @@ EXPORT_SYMBOL(del_timer); ...@@ -539,7 +537,7 @@ EXPORT_SYMBOL(del_timer);
*/ */
int try_to_del_timer_sync(struct timer_list *timer) int try_to_del_timer_sync(struct timer_list *timer)
{ {
tvec_base_t *base; struct tvec_base *base;
unsigned long flags; unsigned long flags;
int ret = -1; int ret = -1;
...@@ -591,7 +589,7 @@ int del_timer_sync(struct timer_list *timer) ...@@ -591,7 +589,7 @@ int del_timer_sync(struct timer_list *timer)
EXPORT_SYMBOL(del_timer_sync); EXPORT_SYMBOL(del_timer_sync);
#endif #endif
static int cascade(tvec_base_t *base, tvec_t *tv, int index) static int cascade(struct tvec_base *base, struct tvec *tv, int index)
{ {
/* cascade all the timers from tv up one level */ /* cascade all the timers from tv up one level */
struct timer_list *timer, *tmp; struct timer_list *timer, *tmp;
...@@ -620,7 +618,7 @@ static int cascade(tvec_base_t *base, tvec_t *tv, int index) ...@@ -620,7 +618,7 @@ static int cascade(tvec_base_t *base, tvec_t *tv, int index)
* This function cascades all vectors and executes all expired timer * This function cascades all vectors and executes all expired timer
* vectors. * vectors.
*/ */
static inline void __run_timers(tvec_base_t *base) static inline void __run_timers(struct tvec_base *base)
{ {
struct timer_list *timer; struct timer_list *timer;
...@@ -678,13 +676,13 @@ static inline void __run_timers(tvec_base_t *base) ...@@ -678,13 +676,13 @@ static inline void __run_timers(tvec_base_t *base)
* is used on S/390 to stop all activity when a cpus is idle. * is used on S/390 to stop all activity when a cpus is idle.
* This functions needs to be called disabled. * This functions needs to be called disabled.
*/ */
static unsigned long __next_timer_interrupt(tvec_base_t *base) static unsigned long __next_timer_interrupt(struct tvec_base *base)
{ {
unsigned long timer_jiffies = base->timer_jiffies; unsigned long timer_jiffies = base->timer_jiffies;
unsigned long expires = timer_jiffies + NEXT_TIMER_MAX_DELTA; unsigned long expires = timer_jiffies + NEXT_TIMER_MAX_DELTA;
int index, slot, array, found = 0; int index, slot, array, found = 0;
struct timer_list *nte; struct timer_list *nte;
tvec_t *varray[4]; struct tvec *varray[4];
/* Look for timer events in tv1. */ /* Look for timer events in tv1. */
index = slot = timer_jiffies & TVR_MASK; index = slot = timer_jiffies & TVR_MASK;
...@@ -716,7 +714,7 @@ static unsigned long __next_timer_interrupt(tvec_base_t *base) ...@@ -716,7 +714,7 @@ static unsigned long __next_timer_interrupt(tvec_base_t *base)
varray[3] = &base->tv5; varray[3] = &base->tv5;
for (array = 0; array < 4; array++) { for (array = 0; array < 4; array++) {
tvec_t *varp = varray[array]; struct tvec *varp = varray[array];
index = slot = timer_jiffies & TVN_MASK; index = slot = timer_jiffies & TVN_MASK;
do { do {
...@@ -795,7 +793,7 @@ static unsigned long cmp_next_hrtimer_event(unsigned long now, ...@@ -795,7 +793,7 @@ static unsigned long cmp_next_hrtimer_event(unsigned long now,
*/ */
unsigned long get_next_timer_interrupt(unsigned long now) unsigned long get_next_timer_interrupt(unsigned long now)
{ {
tvec_base_t *base = __get_cpu_var(tvec_bases); struct tvec_base *base = __get_cpu_var(tvec_bases);
unsigned long expires; unsigned long expires;
spin_lock(&base->lock); spin_lock(&base->lock);
...@@ -894,7 +892,7 @@ static inline void calc_load(unsigned long ticks) ...@@ -894,7 +892,7 @@ static inline void calc_load(unsigned long ticks)
*/ */
static void run_timer_softirq(struct softirq_action *h) static void run_timer_softirq(struct softirq_action *h)
{ {
tvec_base_t *base = __get_cpu_var(tvec_bases); struct tvec_base *base = __get_cpu_var(tvec_bases);
hrtimer_run_pending(); hrtimer_run_pending();
...@@ -1223,7 +1221,7 @@ static struct lock_class_key base_lock_keys[NR_CPUS]; ...@@ -1223,7 +1221,7 @@ static struct lock_class_key base_lock_keys[NR_CPUS];
static int __cpuinit init_timers_cpu(int cpu) static int __cpuinit init_timers_cpu(int cpu)
{ {
int j; int j;
tvec_base_t *base; struct tvec_base *base;
static char __cpuinitdata tvec_base_done[NR_CPUS]; static char __cpuinitdata tvec_base_done[NR_CPUS];
if (!tvec_base_done[cpu]) { if (!tvec_base_done[cpu]) {
...@@ -1278,7 +1276,7 @@ static int __cpuinit init_timers_cpu(int cpu) ...@@ -1278,7 +1276,7 @@ static int __cpuinit init_timers_cpu(int cpu)
} }
#ifdef CONFIG_HOTPLUG_CPU #ifdef CONFIG_HOTPLUG_CPU
static void migrate_timer_list(tvec_base_t *new_base, struct list_head *head) static void migrate_timer_list(struct tvec_base *new_base, struct list_head *head)
{ {
struct timer_list *timer; struct timer_list *timer;
...@@ -1292,8 +1290,8 @@ static void migrate_timer_list(tvec_base_t *new_base, struct list_head *head) ...@@ -1292,8 +1290,8 @@ static void migrate_timer_list(tvec_base_t *new_base, struct list_head *head)
static void __cpuinit migrate_timers(int cpu) static void __cpuinit migrate_timers(int cpu)
{ {
tvec_base_t *old_base; struct tvec_base *old_base;
tvec_base_t *new_base; struct tvec_base *new_base;
int i; int i;
BUG_ON(cpu_online(cpu)); BUG_ON(cpu_online(cpu));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册