hrtimer: constify read-only parameters
PATCH 1/1 hrtimer: constify read-only parameters
Signed-off-by Marcin Slusarz <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
--- include/linux/hrtimer.h | 12 +++++++----- kernel/hrtimer.c | 18 +++++++++++------- 2 files changed, 18 insertions(+), 12 deletions(-)
include/linux/hrtimer.h +7 -5
@@ -407,20 +407,22 @@ static inline u64 hrtimer_forward_now(struct hrtimer *timer, }/* Precise sleep: */ -extern long hrtimer_nanosleep (struct timespec *rqtp, +extern long hrtimer_nanosleep (const struct timespec *rqtp,struct timespec __user *rmtp,const enum hrtimer_mode mode,const clockid_t clockid); -extern long hrtimer_nanosleep_restart (struct restart_block *restart_block); +extern long +hrtimer_nanosleep_restart (const struct restart_block *restart_block);extern void hrtimer_init_sleeper (struct hrtimer_sleeper *sl,struct task_struct *tsk); -extern int schedule_hrtimeout_range (ktime_t *expires,unsigned long delta, +extern int schedule_hrtimeout_range (const ktime_t *expires,unsigned long delta,const enum hrtimer_mode mode); -extern int schedule_hrtimeout_range_clock (ktime_t *expires, +extern int schedule_hrtimeout_range_clock (const ktime_t *expires,unsigned long delta,const enum hrtimer_mode mode,int clock); -extern int schedule_hrtimeout (ktime_t *expires,const enum hrtimer_mode mode); +extern int schedule_hrtimeout (const ktime_t *expires, +const enum hrtimer_mode mode);/* Soft interrupt function to run the hrtimer queues: */ extern void hrtimer_run_queues (void );
kernel/hrtimer.c +11 -7
@@ -1491,7 +1491,8 @@ static int __sched do_nanosleep(struct hrtimer_sleeper *t, enum hrtimer_mode modreturn t->task ==NULL ; } -static int update_rmtp (struct hrtimer *timer,struct timespec __user *rmtp) +static int update_rmtp (const struct hrtimer *timer, +struct timespec __user *rmtp) {struct timespec rmt;ktime_t rem;
@@ -1507,7 +1508,7 @@ static int update_rmtp(struct hrtimer *timer, struct timespec __user *rmtp)return 1 ; } -long __sched hrtimer_nanosleep_restart (struct restart_block *restart) +long __sched hrtimer_nanosleep_restart (const struct restart_block *restart) {struct hrtimer_sleeper t;struct timespec __user *rmtp;
@@ -1534,8 +1535,10 @@ out:return ret; } -long hrtimer_nanosleep (struct timespec *rqtp,struct timespec __user *rmtp, -const enum hrtimer_mode mode,const clockid_t clockid) +long hrtimer_nanosleep (const struct timespec *rqtp, +struct timespec __user *rmtp, +const enum hrtimer_mode mode, +const clockid_t clockid) {struct restart_block *restart;struct hrtimer_sleeper t;
@@ -1730,7 +1733,7 @@ void __init hrtimers_init(void)* @clock: timer clock, CLOCK_MONOTONIC or CLOCK_REALTIME */ int __sched -schedule_hrtimeout_range_clock (ktime_t *expires,unsigned long delta, +schedule_hrtimeout_range_clock (const ktime_t *expires,unsigned long delta,const enum hrtimer_mode mode,int clock) {struct hrtimer_sleeper t;
@@ -1801,7 +1804,8 @@ schedule_hrtimeout_range_clock(ktime_t *expires, unsigned long delta,* * Returns 0 when the timer has expired otherwise -EINTR */ -int __sched schedule_hrtimeout_range(ktime_t *expires, unsigned long delta, +int __sched schedule_hrtimeout_range(const ktime_t *expires, +unsigned long delta,const enum hrtimer_mode mode) { return schedule_hrtimeout_range_clock(expires, delta, mode,
@@ -1831,7 +1835,7 @@ EXPORT_SYMBOL_GPL(schedule_hrtimeout_range);* * Returns 0 when the timer has expired otherwise -EINTR */ -int __sched schedule_hrtimeout(ktime_t *expires, +int __sched schedule_hrtimeout(const ktime_t *expires,const enum hrtimer_mode mode) {return schedule_hrtimeout_range (expires,0 , mode);
Signature · 1 line
1.7.4.rc3