diff options
author | Richard Cochran <richard.cochran@omicron.at> | 2011-02-01 08:50:58 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-02-02 09:28:11 -0500 |
commit | 1e6d767924c74929c0cfe839ae8f37bcee9e544e (patch) | |
tree | 4ace06971e2b3519e556bea2f7e3e999e860eedd /kernel | |
parent | 7cf37e87dd2cfa17a64f28ea7f31eed4525f79e4 (diff) |
time: Correct the *settime* parameters
Both settimeofday() and clock_settime() promise with a 'const'
attribute not to alter the arguments passed in. This patch adds the
missing 'const' attribute into the various kernel functions
implementing these calls.
Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Acked-by: John Stultz <johnstul@us.ibm.com>
LKML-Reference: <20110201134417.545698637@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/posix-timers.c | 4 | ||||
-rw-r--r-- | kernel/time.c | 2 | ||||
-rw-r--r-- | kernel/time/timekeeping.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index 93bd2eb2bc53..21b7ca205f38 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c | |||
@@ -192,7 +192,7 @@ static int common_clock_get(clockid_t which_clock, struct timespec *tp) | |||
192 | } | 192 | } |
193 | 193 | ||
194 | static inline int common_clock_set(const clockid_t which_clock, | 194 | static inline int common_clock_set(const clockid_t which_clock, |
195 | struct timespec *tp) | 195 | const struct timespec *tp) |
196 | { | 196 | { |
197 | return do_sys_settimeofday(tp, NULL); | 197 | return do_sys_settimeofday(tp, NULL); |
198 | } | 198 | } |
@@ -928,7 +928,7 @@ void exit_itimers(struct signal_struct *sig) | |||
928 | } | 928 | } |
929 | 929 | ||
930 | /* Not available / possible... functions */ | 930 | /* Not available / possible... functions */ |
931 | int do_posix_clock_nosettime(const clockid_t clockid, struct timespec *tp) | 931 | int do_posix_clock_nosettime(const clockid_t clockid, const struct timespec *tp) |
932 | { | 932 | { |
933 | return -EINVAL; | 933 | return -EINVAL; |
934 | } | 934 | } |
diff --git a/kernel/time.c b/kernel/time.c index a31b51220ac6..5cb80533d8b5 100644 --- a/kernel/time.c +++ b/kernel/time.c | |||
@@ -150,7 +150,7 @@ static inline void warp_clock(void) | |||
150 | * various programs will get confused when the clock gets warped. | 150 | * various programs will get confused when the clock gets warped. |
151 | */ | 151 | */ |
152 | 152 | ||
153 | int do_sys_settimeofday(struct timespec *tv, struct timezone *tz) | 153 | int do_sys_settimeofday(const struct timespec *tv, const struct timezone *tz) |
154 | { | 154 | { |
155 | static int firsttime = 1; | 155 | static int firsttime = 1; |
156 | int error = 0; | 156 | int error = 0; |
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 02c13a313d15..4f9f65b91323 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -353,7 +353,7 @@ EXPORT_SYMBOL(do_gettimeofday); | |||
353 | * | 353 | * |
354 | * Sets the time of day to the new time and update NTP and notify hrtimers | 354 | * Sets the time of day to the new time and update NTP and notify hrtimers |
355 | */ | 355 | */ |
356 | int do_settimeofday(struct timespec *tv) | 356 | int do_settimeofday(const struct timespec *tv) |
357 | { | 357 | { |
358 | struct timespec ts_delta; | 358 | struct timespec ts_delta; |
359 | unsigned long flags; | 359 | unsigned long flags; |