aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/posix-timers.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2006-01-09 23:52:27 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 11:01:36 -0500
commita924b04ddea9788e09f387fe19ccbede5f09ddd8 (patch)
treeaa519a2427b7686d35ceae764d3e37d69a6ae5e8 /kernel/posix-timers.c
parent57a558757bdbb877b54ed5ea15bd0892e02a707d (diff)
[PATCH] hrtimer: make clockid_t arguments const
add const arguments to the posix-timers.h API functions 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>
Diffstat (limited to 'kernel/posix-timers.c')
-rw-r--r--kernel/posix-timers.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index fdb710777439..69d5a4b5395b 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -151,7 +151,7 @@ static void posix_timer_fn(unsigned long);
151static u64 do_posix_clock_monotonic_gettime_parts( 151static u64 do_posix_clock_monotonic_gettime_parts(
152 struct timespec *tp, struct timespec *mo); 152 struct timespec *tp, struct timespec *mo);
153int do_posix_clock_monotonic_gettime(struct timespec *tp); 153int do_posix_clock_monotonic_gettime(struct timespec *tp);
154static int do_posix_clock_monotonic_get(clockid_t, struct timespec *tp); 154static int do_posix_clock_monotonic_get(const clockid_t, struct timespec *tp);
155 155
156static struct k_itimer *lock_timer(timer_t timer_id, unsigned long *flags); 156static struct k_itimer *lock_timer(timer_t timer_id, unsigned long *flags);
157 157
@@ -176,7 +176,7 @@ static inline void unlock_timer(struct k_itimer *timr, unsigned long flags)
176 * the function pointer CALL in struct k_clock. 176 * the function pointer CALL in struct k_clock.
177 */ 177 */
178 178
179static inline int common_clock_getres(clockid_t which_clock, 179static inline int common_clock_getres(const clockid_t which_clock,
180 struct timespec *tp) 180 struct timespec *tp)
181{ 181{
182 tp->tv_sec = 0; 182 tp->tv_sec = 0;
@@ -184,13 +184,15 @@ static inline int common_clock_getres(clockid_t which_clock,
184 return 0; 184 return 0;
185} 185}
186 186
187static inline int common_clock_get(clockid_t which_clock, struct timespec *tp) 187static inline int common_clock_get(const clockid_t which_clock,
188 struct timespec *tp)
188{ 189{
189 getnstimeofday(tp); 190 getnstimeofday(tp);
190 return 0; 191 return 0;
191} 192}
192 193
193static inline int common_clock_set(clockid_t which_clock, struct timespec *tp) 194static inline int common_clock_set(const clockid_t which_clock,
195 struct timespec *tp)
194{ 196{
195 return do_sys_settimeofday(tp, NULL); 197 return do_sys_settimeofday(tp, NULL);
196} 198}
@@ -207,7 +209,7 @@ static inline int common_timer_create(struct k_itimer *new_timer)
207/* 209/*
208 * These ones are defined below. 210 * These ones are defined below.
209 */ 211 */
210static int common_nsleep(clockid_t, int flags, struct timespec *t); 212static int common_nsleep(const clockid_t, int flags, struct timespec *t);
211static void common_timer_get(struct k_itimer *, struct itimerspec *); 213static void common_timer_get(struct k_itimer *, struct itimerspec *);
212static int common_timer_set(struct k_itimer *, int, 214static int common_timer_set(struct k_itimer *, int,
213 struct itimerspec *, struct itimerspec *); 215 struct itimerspec *, struct itimerspec *);
@@ -216,7 +218,7 @@ static int common_timer_del(struct k_itimer *timer);
216/* 218/*
217 * Return nonzero iff we know a priori this clockid_t value is bogus. 219 * Return nonzero iff we know a priori this clockid_t value is bogus.
218 */ 220 */
219static inline int invalid_clockid(clockid_t which_clock) 221static inline int invalid_clockid(const clockid_t which_clock)
220{ 222{
221 if (which_clock < 0) /* CPU clock, posix_cpu_* will check it */ 223 if (which_clock < 0) /* CPU clock, posix_cpu_* will check it */
222 return 0; 224 return 0;
@@ -522,7 +524,7 @@ static inline struct task_struct * good_sigevent(sigevent_t * event)
522 return rtn; 524 return rtn;
523} 525}
524 526
525void register_posix_clock(clockid_t clock_id, struct k_clock *new_clock) 527void register_posix_clock(const clockid_t clock_id, struct k_clock *new_clock)
526{ 528{
527 if ((unsigned) clock_id >= MAX_CLOCKS) { 529 if ((unsigned) clock_id >= MAX_CLOCKS) {
528 printk("POSIX clock register failed for clock_id %d\n", 530 printk("POSIX clock register failed for clock_id %d\n",
@@ -568,7 +570,7 @@ static void release_posix_timer(struct k_itimer *tmr, int it_id_set)
568/* Create a POSIX.1b interval timer. */ 570/* Create a POSIX.1b interval timer. */
569 571
570asmlinkage long 572asmlinkage long
571sys_timer_create(clockid_t which_clock, 573sys_timer_create(const clockid_t which_clock,
572 struct sigevent __user *timer_event_spec, 574 struct sigevent __user *timer_event_spec,
573 timer_t __user * created_timer_id) 575 timer_t __user * created_timer_id)
574{ 576{
@@ -1195,7 +1197,8 @@ static u64 do_posix_clock_monotonic_gettime_parts(
1195 return jiff; 1197 return jiff;
1196} 1198}
1197 1199
1198static int do_posix_clock_monotonic_get(clockid_t clock, struct timespec *tp) 1200static int do_posix_clock_monotonic_get(const clockid_t clock,
1201 struct timespec *tp)
1199{ 1202{
1200 struct timespec wall_to_mono; 1203 struct timespec wall_to_mono;
1201 1204
@@ -1212,7 +1215,7 @@ int do_posix_clock_monotonic_gettime(struct timespec *tp)
1212 return do_posix_clock_monotonic_get(CLOCK_MONOTONIC, tp); 1215 return do_posix_clock_monotonic_get(CLOCK_MONOTONIC, tp);
1213} 1216}
1214 1217
1215int do_posix_clock_nosettime(clockid_t clockid, struct timespec *tp) 1218int do_posix_clock_nosettime(const clockid_t clockid, struct timespec *tp)
1216{ 1219{
1217 return -EINVAL; 1220 return -EINVAL;
1218} 1221}
@@ -1224,7 +1227,8 @@ int do_posix_clock_notimer_create(struct k_itimer *timer)
1224} 1227}
1225EXPORT_SYMBOL_GPL(do_posix_clock_notimer_create); 1228EXPORT_SYMBOL_GPL(do_posix_clock_notimer_create);
1226 1229
1227int do_posix_clock_nonanosleep(clockid_t clock, int flags, struct timespec *t) 1230int do_posix_clock_nonanosleep(const clockid_t clock, int flags,
1231 struct timespec *t)
1228{ 1232{
1229#ifndef ENOTSUP 1233#ifndef ENOTSUP
1230 return -EOPNOTSUPP; /* aka ENOTSUP in userland for POSIX */ 1234 return -EOPNOTSUPP; /* aka ENOTSUP in userland for POSIX */
@@ -1234,8 +1238,8 @@ int do_posix_clock_nonanosleep(clockid_t clock, int flags, struct timespec *t)
1234} 1238}
1235EXPORT_SYMBOL_GPL(do_posix_clock_nonanosleep); 1239EXPORT_SYMBOL_GPL(do_posix_clock_nonanosleep);
1236 1240
1237asmlinkage long 1241asmlinkage long sys_clock_settime(const clockid_t which_clock,
1238sys_clock_settime(clockid_t which_clock, const struct timespec __user *tp) 1242 const struct timespec __user *tp)
1239{ 1243{
1240 struct timespec new_tp; 1244 struct timespec new_tp;
1241 1245
@@ -1248,7 +1252,7 @@ sys_clock_settime(clockid_t which_clock, const struct timespec __user *tp)
1248} 1252}
1249 1253
1250asmlinkage long 1254asmlinkage long
1251sys_clock_gettime(clockid_t which_clock, struct timespec __user *tp) 1255sys_clock_gettime(const clockid_t which_clock, struct timespec __user *tp)
1252{ 1256{
1253 struct timespec kernel_tp; 1257 struct timespec kernel_tp;
1254 int error; 1258 int error;
@@ -1265,7 +1269,7 @@ sys_clock_gettime(clockid_t which_clock, struct timespec __user *tp)
1265} 1269}
1266 1270
1267asmlinkage long 1271asmlinkage long
1268sys_clock_getres(clockid_t which_clock, struct timespec __user *tp) 1272sys_clock_getres(const clockid_t which_clock, struct timespec __user *tp)
1269{ 1273{
1270 struct timespec rtn_tp; 1274 struct timespec rtn_tp;
1271 int error; 1275 int error;
@@ -1387,7 +1391,7 @@ void clock_was_set(void)
1387long clock_nanosleep_restart(struct restart_block *restart_block); 1391long clock_nanosleep_restart(struct restart_block *restart_block);
1388 1392
1389asmlinkage long 1393asmlinkage long
1390sys_clock_nanosleep(clockid_t which_clock, int flags, 1394sys_clock_nanosleep(const clockid_t which_clock, int flags,
1391 const struct timespec __user *rqtp, 1395 const struct timespec __user *rqtp,
1392 struct timespec __user *rmtp) 1396 struct timespec __user *rmtp)
1393{ 1397{
@@ -1419,7 +1423,7 @@ sys_clock_nanosleep(clockid_t which_clock, int flags,
1419} 1423}
1420 1424
1421 1425
1422static int common_nsleep(clockid_t which_clock, 1426static int common_nsleep(const clockid_t which_clock,
1423 int flags, struct timespec *tsave) 1427 int flags, struct timespec *tsave)
1424{ 1428{
1425 struct timespec t, dum; 1429 struct timespec t, dum;