aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2017-06-13 17:34:33 -0400
committerThomas Gleixner <tglx@linutronix.de>2017-06-13 18:00:47 -0400
commit938e7cf2d569833a5acf689a8926faf507826253 (patch)
tree01d395220896e3d1508edbdca5fbb18dd900a702
parent343d8fc208e43e50525ae6e0fc4845b9966b7318 (diff)
posix-timers: Make nanosleep timespec argument const
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>
-rw-r--r--include/linux/hrtimer.h2
-rw-r--r--kernel/time/alarmtimer.c2
-rw-r--r--kernel/time/hrtimer.c2
-rw-r--r--kernel/time/posix-cpu-timers.c4
-rw-r--r--kernel/time/posix-timers.c4
-rw-r--r--kernel/time/posix-timers.h2
6 files changed, 8 insertions, 8 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index d83b7ed1cb0e..255edd5e7a74 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -454,7 +454,7 @@ static inline u64 hrtimer_forward_now(struct hrtimer *timer,
454/* Precise sleep: */ 454/* Precise sleep: */
455 455
456extern int nanosleep_copyout(struct restart_block *, struct timespec *); 456extern int nanosleep_copyout(struct restart_block *, struct timespec *);
457extern long hrtimer_nanosleep(struct timespec64 *rqtp, 457extern long hrtimer_nanosleep(const struct timespec64 *rqtp,
458 const enum hrtimer_mode mode, 458 const enum hrtimer_mode mode,
459 const clockid_t clockid); 459 const clockid_t clockid);
460 460
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index 7bed4e44f9bd..c991cf212c6d 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -753,7 +753,7 @@ static long __sched alarm_timer_nsleep_restart(struct restart_block *restart)
753 * Handles clock_nanosleep calls against _ALARM clockids 753 * Handles clock_nanosleep calls against _ALARM clockids
754 */ 754 */
755static int alarm_timer_nsleep(const clockid_t which_clock, int flags, 755static int alarm_timer_nsleep(const clockid_t which_clock, int flags,
756 struct timespec64 *tsreq) 756 const struct timespec64 *tsreq)
757{ 757{
758 enum alarmtimer_type type = clock2alarm(which_clock); 758 enum alarmtimer_type type = clock2alarm(which_clock);
759 struct restart_block *restart = &current->restart_block; 759 struct restart_block *restart = &current->restart_block;
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 45f83cc7c0c7..81da124f1115 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1510,7 +1510,7 @@ static long __sched hrtimer_nanosleep_restart(struct restart_block *restart)
1510 return ret; 1510 return ret;
1511} 1511}
1512 1512
1513long hrtimer_nanosleep(struct timespec64 *rqtp, 1513long hrtimer_nanosleep(const struct timespec64 *rqtp,
1514 const enum hrtimer_mode mode, const clockid_t clockid) 1514 const enum hrtimer_mode mode, const clockid_t clockid)
1515{ 1515{
1516 struct restart_block *restart; 1516 struct restart_block *restart;
diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
index 3adfa42ca24c..9df618ee64cf 100644
--- a/kernel/time/posix-cpu-timers.c
+++ b/kernel/time/posix-cpu-timers.c
@@ -1328,7 +1328,7 @@ static int do_cpu_nanosleep(const clockid_t which_clock, int flags,
1328static long posix_cpu_nsleep_restart(struct restart_block *restart_block); 1328static long posix_cpu_nsleep_restart(struct restart_block *restart_block);
1329 1329
1330static int posix_cpu_nsleep(const clockid_t which_clock, int flags, 1330static int posix_cpu_nsleep(const clockid_t which_clock, int flags,
1331 struct timespec64 *rqtp) 1331 const struct timespec64 *rqtp)
1332{ 1332{
1333 struct restart_block *restart_block = &current->restart_block; 1333 struct restart_block *restart_block = &current->restart_block;
1334 int error; 1334 int error;
@@ -1383,7 +1383,7 @@ static int process_cpu_timer_create(struct k_itimer *timer)
1383 return posix_cpu_timer_create(timer); 1383 return posix_cpu_timer_create(timer);
1384} 1384}
1385static int process_cpu_nsleep(const clockid_t which_clock, int flags, 1385static int process_cpu_nsleep(const clockid_t which_clock, int flags,
1386 struct timespec64 *rqtp) 1386 const struct timespec64 *rqtp)
1387{ 1387{
1388 return posix_cpu_nsleep(PROCESS_CLOCK, flags, rqtp); 1388 return posix_cpu_nsleep(PROCESS_CLOCK, flags, rqtp);
1389} 1389}
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index c9f45a84fb8b..82d67be7d9d1 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -1214,9 +1214,9 @@ COMPAT_SYSCALL_DEFINE2(clock_getres, clockid_t, which_clock,
1214 * nanosleep for monotonic and realtime clocks 1214 * nanosleep for monotonic and realtime clocks
1215 */ 1215 */
1216static int common_nsleep(const clockid_t which_clock, int flags, 1216static int common_nsleep(const clockid_t which_clock, int flags,
1217 struct timespec64 *tsave) 1217 const struct timespec64 *rqtp)
1218{ 1218{
1219 return hrtimer_nanosleep(tsave, flags & TIMER_ABSTIME ? 1219 return hrtimer_nanosleep(rqtp, flags & TIMER_ABSTIME ?
1220 HRTIMER_MODE_ABS : HRTIMER_MODE_REL, 1220 HRTIMER_MODE_ABS : HRTIMER_MODE_REL,
1221 which_clock); 1221 which_clock);
1222} 1222}
diff --git a/kernel/time/posix-timers.h b/kernel/time/posix-timers.h
index 5e69bb85629f..fb303c3be4d3 100644
--- a/kernel/time/posix-timers.h
+++ b/kernel/time/posix-timers.h
@@ -10,7 +10,7 @@ struct k_clock {
10 int (*clock_adj)(const clockid_t which_clock, struct timex *tx); 10 int (*clock_adj)(const clockid_t which_clock, struct timex *tx);
11 int (*timer_create)(struct k_itimer *timer); 11 int (*timer_create)(struct k_itimer *timer);
12 int (*nsleep)(const clockid_t which_clock, int flags, 12 int (*nsleep)(const clockid_t which_clock, int flags,
13 struct timespec64 *); 13 const struct timespec64 *);
14 int (*timer_set)(struct k_itimer *timr, int flags, 14 int (*timer_set)(struct k_itimer *timr, int flags,
15 struct itimerspec64 *new_setting, 15 struct itimerspec64 *new_setting,
16 struct itimerspec64 *old_setting); 16 struct itimerspec64 *old_setting);