diff options
| author | Deepa Dinamani <deepa.kernel@gmail.com> | 2018-07-03 01:44:21 -0400 |
|---|---|---|
| committer | Arnd Bergmann <arnd@arndb.de> | 2019-02-06 18:13:27 -0500 |
| commit | ead25417f82ed7f8a21da4dcefc768169f7da884 (patch) | |
| tree | b97e7cae6a4b9c896e479c8c723706e59a95619b /include/linux | |
| parent | 1a596398a3d75f966b75f428e992cf1f242f9a5b (diff) | |
timex: use __kernel_timex internally
struct timex is not y2038 safe.
Replace all uses of timex with y2038 safe __kernel_timex.
Note that struct __kernel_timex is an ABI interface definition.
We could define a new structure based on __kernel_timex that
is only available internally instead. Right now, there isn't
a strong motivation for this as the structure is isolated to
a few defined struct timex interfaces and such a structure would
be exactly the same as struct timex.
The patch was generated by the following coccinelle script:
virtual patch
@depends on patch forall@
identifier ts;
expression e;
@@
(
- struct timex ts;
+ struct __kernel_timex ts;
|
- struct timex ts = {};
+ struct __kernel_timex ts = {};
|
- struct timex ts = e;
+ struct __kernel_timex ts = e;
|
- struct timex *ts;
+ struct __kernel_timex *ts;
|
(memset \| copy_from_user \| copy_to_user \)(...,
- sizeof(struct timex))
+ sizeof(struct __kernel_timex))
)
@depends on patch forall@
identifier ts;
identifier fn;
@@
fn(...,
- struct timex *ts,
+ struct __kernel_timex *ts,
...) {
...
}
@depends on patch forall@
identifier ts;
identifier fn;
@@
fn(...,
- struct timex *ts) {
+ struct __kernel_timex *ts) {
...
}
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: linux-alpha@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/posix-clock.h | 2 | ||||
| -rw-r--r-- | include/linux/time32.h | 6 | ||||
| -rw-r--r-- | include/linux/timex.h | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/include/linux/posix-clock.h b/include/linux/posix-clock.h index 3a3bc71017d5..18674d7d5b1c 100644 --- a/include/linux/posix-clock.h +++ b/include/linux/posix-clock.h | |||
| @@ -51,7 +51,7 @@ struct posix_clock; | |||
| 51 | struct posix_clock_operations { | 51 | struct posix_clock_operations { |
| 52 | struct module *owner; | 52 | struct module *owner; |
| 53 | 53 | ||
| 54 | int (*clock_adjtime)(struct posix_clock *pc, struct timex *tx); | 54 | int (*clock_adjtime)(struct posix_clock *pc, struct __kernel_timex *tx); |
| 55 | 55 | ||
| 56 | int (*clock_gettime)(struct posix_clock *pc, struct timespec64 *ts); | 56 | int (*clock_gettime)(struct posix_clock *pc, struct timespec64 *ts); |
| 57 | 57 | ||
diff --git a/include/linux/time32.h b/include/linux/time32.h index 820a22e2b98b..0a1f302a1753 100644 --- a/include/linux/time32.h +++ b/include/linux/time32.h | |||
| @@ -69,9 +69,9 @@ extern int get_old_itimerspec32(struct itimerspec64 *its, | |||
| 69 | const struct old_itimerspec32 __user *uits); | 69 | const struct old_itimerspec32 __user *uits); |
| 70 | extern int put_old_itimerspec32(const struct itimerspec64 *its, | 70 | extern int put_old_itimerspec32(const struct itimerspec64 *its, |
| 71 | struct old_itimerspec32 __user *uits); | 71 | struct old_itimerspec32 __user *uits); |
| 72 | struct timex; | 72 | struct __kernel_timex; |
| 73 | int get_old_timex32(struct timex *, const struct old_timex32 __user *); | 73 | int get_old_timex32(struct __kernel_timex *, const struct old_timex32 __user *); |
| 74 | int put_old_timex32(struct old_timex32 __user *, const struct timex *); | 74 | int put_old_timex32(struct old_timex32 __user *, const struct __kernel_timex *); |
| 75 | 75 | ||
| 76 | #if __BITS_PER_LONG == 64 | 76 | #if __BITS_PER_LONG == 64 |
| 77 | 77 | ||
diff --git a/include/linux/timex.h b/include/linux/timex.h index a15e6aeb8d49..4aff9f0d1367 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
| @@ -158,8 +158,8 @@ extern unsigned long tick_nsec; /* SHIFTED_HZ period (nsec) */ | |||
| 158 | #define NTP_INTERVAL_FREQ (HZ) | 158 | #define NTP_INTERVAL_FREQ (HZ) |
| 159 | #define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ) | 159 | #define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ) |
| 160 | 160 | ||
| 161 | extern int do_adjtimex(struct timex *); | 161 | extern int do_adjtimex(struct __kernel_timex *); |
| 162 | extern int do_clock_adjtime(const clockid_t which_clock, struct timex * ktx); | 162 | extern int do_clock_adjtime(const clockid_t which_clock, struct __kernel_timex * ktx); |
| 163 | 163 | ||
| 164 | extern void hardpps(const struct timespec64 *, const struct timespec64 *); | 164 | extern void hardpps(const struct timespec64 *, const struct timespec64 *); |
| 165 | 165 | ||
