]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
posix-timers: Make nanosleep timespec argument const
authorThomas Gleixner <tglx@linutronix.de>
Tue, 13 Jun 2017 21:34:33 +0000 (23:34 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 13 Jun 2017 22:00:47 +0000 (00:00 +0200)
No nanosleep implementation modifies the rqtp argument. Mark is const.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
include/linux/hrtimer.h
kernel/time/alarmtimer.c
kernel/time/hrtimer.c
kernel/time/posix-cpu-timers.c
kernel/time/posix-timers.c
kernel/time/posix-timers.h

index d83b7ed1cb0e43e0cffc29e4e0af96e4788124fd..255edd5e7a7496f98868f640b581e4ba1a0dedd9 100644 (file)
@@ -454,7 +454,7 @@ static inline u64 hrtimer_forward_now(struct hrtimer *timer,
 /* Precise sleep: */
 
 extern int nanosleep_copyout(struct restart_block *, struct timespec *);
-extern long hrtimer_nanosleep(struct timespec64 *rqtp,
+extern long hrtimer_nanosleep(const struct timespec64 *rqtp,
                              const enum hrtimer_mode mode,
                              const clockid_t clockid);
 
index 7bed4e44f9bd75bf9a8779264357109b911f8fa8..c991cf212c6dbb588403060958cf831a9cabc2c2 100644 (file)
@@ -753,7 +753,7 @@ static long __sched alarm_timer_nsleep_restart(struct restart_block *restart)
  * Handles clock_nanosleep calls against _ALARM clockids
  */
 static int alarm_timer_nsleep(const clockid_t which_clock, int flags,
-                             struct timespec64 *tsreq)
+                             const struct timespec64 *tsreq)
 {
        enum  alarmtimer_type type = clock2alarm(which_clock);
        struct restart_block *restart = &current->restart_block;
index 45f83cc7c0c7d0b3e9e7582e0573d983e1b6d3dc..81da124f11159469c7d392809f9551e7886879ce 100644 (file)
@@ -1510,7 +1510,7 @@ static long __sched hrtimer_nanosleep_restart(struct restart_block *restart)
        return ret;
 }
 
-long hrtimer_nanosleep(struct timespec64 *rqtp,
+long hrtimer_nanosleep(const struct timespec64 *rqtp,
                       const enum hrtimer_mode mode, const clockid_t clockid)
 {
        struct restart_block *restart;
index 3adfa42ca24ce5b5c13e7fba50a83c77ead2bedd..9df618ee64cf235edfef10d1b113d5cfdc78c783 100644 (file)
@@ -1328,7 +1328,7 @@ static int do_cpu_nanosleep(const clockid_t which_clock, int flags,
 static long posix_cpu_nsleep_restart(struct restart_block *restart_block);
 
 static int posix_cpu_nsleep(const clockid_t which_clock, int flags,
-                           struct timespec64 *rqtp)
+                           const struct timespec64 *rqtp)
 {
        struct restart_block *restart_block = &current->restart_block;
        int error;
@@ -1383,7 +1383,7 @@ static int process_cpu_timer_create(struct k_itimer *timer)
        return posix_cpu_timer_create(timer);
 }
 static int process_cpu_nsleep(const clockid_t which_clock, int flags,
-                             struct timespec64 *rqtp)
+                             const struct timespec64 *rqtp)
 {
        return posix_cpu_nsleep(PROCESS_CLOCK, flags, rqtp);
 }
index c9f45a84fb8b0e5dcd2f910403e9b97c51f64605..82d67be7d9d18467dcfacb5780ec33ade50d061d 100644 (file)
@@ -1214,9 +1214,9 @@ COMPAT_SYSCALL_DEFINE2(clock_getres, clockid_t, which_clock,
  * nanosleep for monotonic and realtime clocks
  */
 static int common_nsleep(const clockid_t which_clock, int flags,
-                        struct timespec64 *tsave)
+                        const struct timespec64 *rqtp)
 {
-       return hrtimer_nanosleep(tsave, flags & TIMER_ABSTIME ?
+       return hrtimer_nanosleep(rqtp, flags & TIMER_ABSTIME ?
                                 HRTIMER_MODE_ABS : HRTIMER_MODE_REL,
                                 which_clock);
 }
index 5e69bb85629fdb359edd4d8657754e41ffcb1744..fb303c3be4d321c6a0ffbf117de15be2fa78d82e 100644 (file)
@@ -10,7 +10,7 @@ struct k_clock {
        int     (*clock_adj)(const clockid_t which_clock, struct timex *tx);
        int     (*timer_create)(struct k_itimer *timer);
        int     (*nsleep)(const clockid_t which_clock, int flags,
-                         struct timespec64 *);
+                         const struct timespec64 *);
        int     (*timer_set)(struct k_itimer *timr, int flags,
                             struct itimerspec64 *new_setting,
                             struct itimerspec64 *old_setting);