Commit 2a698971941bf5e6ebe96275f7d5318b2cf91ccf

Authored by Thomas Gleixner
Committed by Linus Torvalds
1 parent a924b04dde

[PATCH] hrtimer: coding style and white space cleanup 2

style/whitespace/macro cleanups of posix-timers.h

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 44 additions and 36 deletions Side-by-side Diff

include/linux/posix-timers.h
... ... @@ -42,7 +42,7 @@
42 42 timer_t it_id; /* timer id */
43 43 int it_overrun; /* overrun on pending signal */
44 44 int it_overrun_last; /* overrun on last delivered signal */
45   - int it_requeue_pending; /* waiting to requeue this timer */
  45 + int it_requeue_pending; /* waiting to requeue this timer */
46 46 #define REQUEUE_PENDING 1
47 47 int it_sigev_notify; /* notify word of sigevent struct */
48 48 int it_sigev_signo; /* signo word of sigevent struct */
... ... @@ -52,8 +52,10 @@
52 52 union {
53 53 struct {
54 54 struct timer_list timer;
55   - struct list_head abs_timer_entry; /* clock abs_timer_list */
56   - struct timespec wall_to_prev; /* wall_to_monotonic used when set */
  55 + /* clock abs_timer_list: */
  56 + struct list_head abs_timer_entry;
  57 + /* wall_to_monotonic used when set: */
  58 + struct timespec wall_to_prev;
57 59 unsigned long incr; /* interval in jiffies */
58 60 } real;
59 61 struct cpu_timer_list cpu;
60 62  
61 63  
... ... @@ -70,14 +72,16 @@
70 72 struct list_head list;
71 73 spinlock_t lock;
72 74 };
  75 +
73 76 struct k_clock {
74   - int res; /* in nano seconds */
  77 + int res; /* in nanoseconds */
75 78 int (*clock_getres) (const clockid_t which_clock, struct timespec *tp);
76 79 struct k_clock_abs *abs_struct;
77 80 int (*clock_set) (const clockid_t which_clock, struct timespec * tp);
78 81 int (*clock_get) (const clockid_t which_clock, struct timespec * tp);
79 82 int (*timer_create) (struct k_itimer *timer);
80   - int (*nsleep) (const clockid_t which_clock, int flags, struct timespec *);
  83 + int (*nsleep) (const clockid_t which_clock, int flags,
  84 + struct timespec *);
81 85 int (*timer_set) (struct k_itimer * timr, int flags,
82 86 struct itimerspec * new_setting,
83 87 struct itimerspec * old_setting);
... ... @@ -89,7 +93,7 @@
89 93  
90 94 void register_posix_clock(const clockid_t clock_id, struct k_clock *new_clock);
91 95  
92   -/* Error handlers for timer_create, nanosleep and settime */
  96 +/* error handlers for timer_create, nanosleep and settime */
93 97 int do_posix_clock_notimer_create(struct k_itimer *timer);
94 98 int do_posix_clock_nonanosleep(const clockid_t, int flags, struct timespec *);
95 99 int do_posix_clock_nosettime(const clockid_t, struct timespec *tp);
96 100  
97 101  
98 102  
99 103  
100 104  
... ... @@ -101,40 +105,44 @@
101 105 unsigned long jiffies;
102 106 };
103 107  
104   -#define posix_get_now(now) (now)->jiffies = jiffies;
  108 +#define posix_get_now(now) \
  109 + do { (now)->jiffies = jiffies; } while (0)
  110 +
105 111 #define posix_time_before(timer, now) \
106 112 time_before((timer)->expires, (now)->jiffies)
107 113  
108 114 #define posix_bump_timer(timr, now) \
109   - do { \
110   - long delta, orun; \
111   - delta = now.jiffies - (timr)->it.real.timer.expires; \
112   - if (delta >= 0) { \
113   - orun = 1 + (delta / (timr)->it.real.incr); \
114   - (timr)->it.real.timer.expires += \
115   - orun * (timr)->it.real.incr; \
116   - (timr)->it_overrun += orun; \
117   - } \
118   - }while (0)
  115 + do { \
  116 + long delta, orun; \
  117 + \
  118 + delta = (now).jiffies - (timr)->it.real.timer.expires; \
  119 + if (delta >= 0) { \
  120 + orun = 1 + (delta / (timr)->it.real.incr); \
  121 + (timr)->it.real.timer.expires += \
  122 + orun * (timr)->it.real.incr; \
  123 + (timr)->it_overrun += orun; \
  124 + } \
  125 + } while (0)
119 126  
120   -int posix_cpu_clock_getres(const clockid_t which_clock, struct timespec *);
121   -int posix_cpu_clock_get(const clockid_t which_clock, struct timespec *);
122   -int posix_cpu_clock_set(const clockid_t which_clock, const struct timespec *tp);
123   -int posix_cpu_timer_create(struct k_itimer *);
124   -int posix_cpu_nsleep(const clockid_t, int, struct timespec *);
125   -int posix_cpu_timer_set(struct k_itimer *, int,
126   - struct itimerspec *, struct itimerspec *);
127   -int posix_cpu_timer_del(struct k_itimer *);
128   -void posix_cpu_timer_get(struct k_itimer *, struct itimerspec *);
  127 +int posix_cpu_clock_getres(const clockid_t which_clock, struct timespec *ts);
  128 +int posix_cpu_clock_get(const clockid_t which_clock, struct timespec *ts);
  129 +int posix_cpu_clock_set(const clockid_t which_clock, const struct timespec *ts);
  130 +int posix_cpu_timer_create(struct k_itimer *timer);
  131 +int posix_cpu_nsleep(const clockid_t which_clock, int flags,
  132 + struct timespec *ts);
  133 +int posix_cpu_timer_set(struct k_itimer *timer, int flags,
  134 + struct itimerspec *new, struct itimerspec *old);
  135 +int posix_cpu_timer_del(struct k_itimer *timer);
  136 +void posix_cpu_timer_get(struct k_itimer *timer, struct itimerspec *itp);
129 137  
130   -void posix_cpu_timer_schedule(struct k_itimer *);
  138 +void posix_cpu_timer_schedule(struct k_itimer *timer);
131 139  
132   -void run_posix_cpu_timers(struct task_struct *);
133   -void posix_cpu_timers_exit(struct task_struct *);
134   -void posix_cpu_timers_exit_group(struct task_struct *);
  140 +void run_posix_cpu_timers(struct task_struct *task);
  141 +void posix_cpu_timers_exit(struct task_struct *task);
  142 +void posix_cpu_timers_exit_group(struct task_struct *task);
135 143  
136   -void set_process_cpu_timer(struct task_struct *, unsigned int,
137   - cputime_t *, cputime_t *);
  144 +void set_process_cpu_timer(struct task_struct *task, unsigned int clock_idx,
  145 + cputime_t *newval, cputime_t *oldval);
138 146  
139 147 #endif