Commit a6fa8e5a6172a5a5bc06ed04f34e50b36c978127
Committed by
Ingo Molnar
1 parent
213eca7f48
Exists in
master
and in
39 other branches
time: clean hungarian notation from timers
Clean up hungarian notation from timer code. Signed-off-by: Pavel Machek <pavel@suse.cz> Cc: john stultz <johnstul@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Showing 2 changed files with 42 additions and 44 deletions Side-by-side Diff
include/linux/timer.h
... | ... | @@ -5,7 +5,7 @@ |
5 | 5 | #include <linux/ktime.h> |
6 | 6 | #include <linux/stddef.h> |
7 | 7 | |
8 | -struct tvec_t_base_s; | |
8 | +struct tvec_base; | |
9 | 9 | |
10 | 10 | struct timer_list { |
11 | 11 | struct list_head entry; |
... | ... | @@ -14,7 +14,7 @@ |
14 | 14 | void (*function)(unsigned long); |
15 | 15 | unsigned long data; |
16 | 16 | |
17 | - struct tvec_t_base_s *base; | |
17 | + struct tvec_base *base; | |
18 | 18 | #ifdef CONFIG_TIMER_STATS |
19 | 19 | void *start_site; |
20 | 20 | char start_comm[16]; |
... | ... | @@ -22,7 +22,7 @@ |
22 | 22 | #endif |
23 | 23 | }; |
24 | 24 | |
25 | -extern struct tvec_t_base_s boot_tvec_bases; | |
25 | +extern struct tvec_base boot_tvec_bases; | |
26 | 26 | |
27 | 27 | #define TIMER_INITIALIZER(_function, _expires, _data) { \ |
28 | 28 | .function = (_function), \ |
kernel/timer.c
... | ... | @@ -58,59 +58,57 @@ |
58 | 58 | #define TVN_MASK (TVN_SIZE - 1) |
59 | 59 | #define TVR_MASK (TVR_SIZE - 1) |
60 | 60 | |
61 | -typedef struct tvec_s { | |
61 | +struct tvec { | |
62 | 62 | struct list_head vec[TVN_SIZE]; |
63 | -} tvec_t; | |
63 | +}; | |
64 | 64 | |
65 | -typedef struct tvec_root_s { | |
65 | +struct tvec_root { | |
66 | 66 | struct list_head vec[TVR_SIZE]; |
67 | -} tvec_root_t; | |
67 | +}; | |
68 | 68 | |
69 | -struct tvec_t_base_s { | |
69 | +struct tvec_base { | |
70 | 70 | spinlock_t lock; |
71 | 71 | struct timer_list *running_timer; |
72 | 72 | unsigned long timer_jiffies; |
73 | - tvec_root_t tv1; | |
74 | - tvec_t tv2; | |
75 | - tvec_t tv3; | |
76 | - tvec_t tv4; | |
77 | - tvec_t tv5; | |
73 | + struct tvec_root tv1; | |
74 | + struct tvec tv2; | |
75 | + struct tvec tv3; | |
76 | + struct tvec tv4; | |
77 | + struct tvec tv5; | |
78 | 78 | } ____cacheline_aligned; |
79 | 79 | |
80 | -typedef struct tvec_t_base_s tvec_base_t; | |
81 | - | |
82 | -tvec_base_t boot_tvec_bases; | |
80 | +struct tvec_base boot_tvec_bases; | |
83 | 81 | EXPORT_SYMBOL(boot_tvec_bases); |
84 | -static DEFINE_PER_CPU(tvec_base_t *, tvec_bases) = &boot_tvec_bases; | |
82 | +static DEFINE_PER_CPU(struct tvec_base *, tvec_bases) = &boot_tvec_bases; | |
85 | 83 | |
86 | 84 | /* |
87 | - * Note that all tvec_bases is 2 byte aligned and lower bit of | |
85 | + * Note that all tvec_bases are 2 byte aligned and lower bit of | |
88 | 86 | * base in timer_list is guaranteed to be zero. Use the LSB for |
89 | 87 | * the new flag to indicate whether the timer is deferrable |
90 | 88 | */ |
91 | 89 | #define TBASE_DEFERRABLE_FLAG (0x1) |
92 | 90 | |
93 | 91 | /* Functions below help us manage 'deferrable' flag */ |
94 | -static inline unsigned int tbase_get_deferrable(tvec_base_t *base) | |
92 | +static inline unsigned int tbase_get_deferrable(struct tvec_base *base) | |
95 | 93 | { |
96 | 94 | return ((unsigned int)(unsigned long)base & TBASE_DEFERRABLE_FLAG); |
97 | 95 | } |
98 | 96 | |
99 | -static inline tvec_base_t *tbase_get_base(tvec_base_t *base) | |
97 | +static inline struct tvec_base *tbase_get_base(struct tvec_base *base) | |
100 | 98 | { |
101 | - return ((tvec_base_t *)((unsigned long)base & ~TBASE_DEFERRABLE_FLAG)); | |
99 | + return ((struct tvec_base *)((unsigned long)base & ~TBASE_DEFERRABLE_FLAG)); | |
102 | 100 | } |
103 | 101 | |
104 | 102 | static inline void timer_set_deferrable(struct timer_list *timer) |
105 | 103 | { |
106 | - timer->base = ((tvec_base_t *)((unsigned long)(timer->base) | | |
104 | + timer->base = ((struct tvec_base *)((unsigned long)(timer->base) | | |
107 | 105 | TBASE_DEFERRABLE_FLAG)); |
108 | 106 | } |
109 | 107 | |
110 | 108 | static inline void |
111 | -timer_set_base(struct timer_list *timer, tvec_base_t *new_base) | |
109 | +timer_set_base(struct timer_list *timer, struct tvec_base *new_base) | |
112 | 110 | { |
113 | - timer->base = (tvec_base_t *)((unsigned long)(new_base) | | |
111 | + timer->base = (struct tvec_base *)((unsigned long)(new_base) | | |
114 | 112 | tbase_get_deferrable(timer->base)); |
115 | 113 | } |
116 | 114 | |
... | ... | @@ -246,7 +244,7 @@ |
246 | 244 | EXPORT_SYMBOL_GPL(round_jiffies_relative); |
247 | 245 | |
248 | 246 | |
249 | -static inline void set_running_timer(tvec_base_t *base, | |
247 | +static inline void set_running_timer(struct tvec_base *base, | |
250 | 248 | struct timer_list *timer) |
251 | 249 | { |
252 | 250 | #ifdef CONFIG_SMP |
... | ... | @@ -254,7 +252,7 @@ |
254 | 252 | #endif |
255 | 253 | } |
256 | 254 | |
257 | -static void internal_add_timer(tvec_base_t *base, struct timer_list *timer) | |
255 | +static void internal_add_timer(struct tvec_base *base, struct timer_list *timer) | |
258 | 256 | { |
259 | 257 | unsigned long expires = timer->expires; |
260 | 258 | unsigned long idx = expires - base->timer_jiffies; |
261 | 259 | |
262 | 260 | |
... | ... | @@ -371,14 +369,14 @@ |
371 | 369 | * possible to set timer->base = NULL and drop the lock: the timer remains |
372 | 370 | * locked. |
373 | 371 | */ |
374 | -static tvec_base_t *lock_timer_base(struct timer_list *timer, | |
372 | +static struct tvec_base *lock_timer_base(struct timer_list *timer, | |
375 | 373 | unsigned long *flags) |
376 | 374 | __acquires(timer->base->lock) |
377 | 375 | { |
378 | - tvec_base_t *base; | |
376 | + struct tvec_base *base; | |
379 | 377 | |
380 | 378 | for (;;) { |
381 | - tvec_base_t *prelock_base = timer->base; | |
379 | + struct tvec_base *prelock_base = timer->base; | |
382 | 380 | base = tbase_get_base(prelock_base); |
383 | 381 | if (likely(base != NULL)) { |
384 | 382 | spin_lock_irqsave(&base->lock, *flags); |
... | ... | @@ -393,7 +391,7 @@ |
393 | 391 | |
394 | 392 | int __mod_timer(struct timer_list *timer, unsigned long expires) |
395 | 393 | { |
396 | - tvec_base_t *base, *new_base; | |
394 | + struct tvec_base *base, *new_base; | |
397 | 395 | unsigned long flags; |
398 | 396 | int ret = 0; |
399 | 397 | |
... | ... | @@ -445,7 +443,7 @@ |
445 | 443 | */ |
446 | 444 | void add_timer_on(struct timer_list *timer, int cpu) |
447 | 445 | { |
448 | - tvec_base_t *base = per_cpu(tvec_bases, cpu); | |
446 | + struct tvec_base *base = per_cpu(tvec_bases, cpu); | |
449 | 447 | unsigned long flags; |
450 | 448 | |
451 | 449 | timer_stats_timer_set_start_info(timer); |
... | ... | @@ -508,7 +506,7 @@ |
508 | 506 | */ |
509 | 507 | int del_timer(struct timer_list *timer) |
510 | 508 | { |
511 | - tvec_base_t *base; | |
509 | + struct tvec_base *base; | |
512 | 510 | unsigned long flags; |
513 | 511 | int ret = 0; |
514 | 512 | |
... | ... | @@ -539,7 +537,7 @@ |
539 | 537 | */ |
540 | 538 | int try_to_del_timer_sync(struct timer_list *timer) |
541 | 539 | { |
542 | - tvec_base_t *base; | |
540 | + struct tvec_base *base; | |
543 | 541 | unsigned long flags; |
544 | 542 | int ret = -1; |
545 | 543 | |
... | ... | @@ -591,7 +589,7 @@ |
591 | 589 | EXPORT_SYMBOL(del_timer_sync); |
592 | 590 | #endif |
593 | 591 | |
594 | -static int cascade(tvec_base_t *base, tvec_t *tv, int index) | |
592 | +static int cascade(struct tvec_base *base, struct tvec *tv, int index) | |
595 | 593 | { |
596 | 594 | /* cascade all the timers from tv up one level */ |
597 | 595 | struct timer_list *timer, *tmp; |
... | ... | @@ -620,7 +618,7 @@ |
620 | 618 | * This function cascades all vectors and executes all expired timer |
621 | 619 | * vectors. |
622 | 620 | */ |
623 | -static inline void __run_timers(tvec_base_t *base) | |
621 | +static inline void __run_timers(struct tvec_base *base) | |
624 | 622 | { |
625 | 623 | struct timer_list *timer; |
626 | 624 | |
627 | 625 | |
... | ... | @@ -678,13 +676,13 @@ |
678 | 676 | * is used on S/390 to stop all activity when a cpus is idle. |
679 | 677 | * This functions needs to be called disabled. |
680 | 678 | */ |
681 | -static unsigned long __next_timer_interrupt(tvec_base_t *base) | |
679 | +static unsigned long __next_timer_interrupt(struct tvec_base *base) | |
682 | 680 | { |
683 | 681 | unsigned long timer_jiffies = base->timer_jiffies; |
684 | 682 | unsigned long expires = timer_jiffies + NEXT_TIMER_MAX_DELTA; |
685 | 683 | int index, slot, array, found = 0; |
686 | 684 | struct timer_list *nte; |
687 | - tvec_t *varray[4]; | |
685 | + struct tvec *varray[4]; | |
688 | 686 | |
689 | 687 | /* Look for timer events in tv1. */ |
690 | 688 | index = slot = timer_jiffies & TVR_MASK; |
... | ... | @@ -716,7 +714,7 @@ |
716 | 714 | varray[3] = &base->tv5; |
717 | 715 | |
718 | 716 | for (array = 0; array < 4; array++) { |
719 | - tvec_t *varp = varray[array]; | |
717 | + struct tvec *varp = varray[array]; | |
720 | 718 | |
721 | 719 | index = slot = timer_jiffies & TVN_MASK; |
722 | 720 | do { |
... | ... | @@ -795,7 +793,7 @@ |
795 | 793 | */ |
796 | 794 | unsigned long get_next_timer_interrupt(unsigned long now) |
797 | 795 | { |
798 | - tvec_base_t *base = __get_cpu_var(tvec_bases); | |
796 | + struct tvec_base *base = __get_cpu_var(tvec_bases); | |
799 | 797 | unsigned long expires; |
800 | 798 | |
801 | 799 | spin_lock(&base->lock); |
... | ... | @@ -894,7 +892,7 @@ |
894 | 892 | */ |
895 | 893 | static void run_timer_softirq(struct softirq_action *h) |
896 | 894 | { |
897 | - tvec_base_t *base = __get_cpu_var(tvec_bases); | |
895 | + struct tvec_base *base = __get_cpu_var(tvec_bases); | |
898 | 896 | |
899 | 897 | hrtimer_run_pending(); |
900 | 898 | |
... | ... | @@ -1223,7 +1221,7 @@ |
1223 | 1221 | static int __cpuinit init_timers_cpu(int cpu) |
1224 | 1222 | { |
1225 | 1223 | int j; |
1226 | - tvec_base_t *base; | |
1224 | + struct tvec_base *base; | |
1227 | 1225 | static char __cpuinitdata tvec_base_done[NR_CPUS]; |
1228 | 1226 | |
1229 | 1227 | if (!tvec_base_done[cpu]) { |
... | ... | @@ -1278,7 +1276,7 @@ |
1278 | 1276 | } |
1279 | 1277 | |
1280 | 1278 | #ifdef CONFIG_HOTPLUG_CPU |
1281 | -static void migrate_timer_list(tvec_base_t *new_base, struct list_head *head) | |
1279 | +static void migrate_timer_list(struct tvec_base *new_base, struct list_head *head) | |
1282 | 1280 | { |
1283 | 1281 | struct timer_list *timer; |
1284 | 1282 | |
... | ... | @@ -1292,8 +1290,8 @@ |
1292 | 1290 | |
1293 | 1291 | static void __cpuinit migrate_timers(int cpu) |
1294 | 1292 | { |
1295 | - tvec_base_t *old_base; | |
1296 | - tvec_base_t *new_base; | |
1293 | + struct tvec_base *old_base; | |
1294 | + struct tvec_base *new_base; | |
1297 | 1295 | int i; |
1298 | 1296 | |
1299 | 1297 | BUG_ON(cpu_online(cpu)); |