Skip to content

Commit 595abba

Browse files
arndbtorvalds
authored andcommitted
y2038: remove ktime to/from timespec/timeval conversion
A couple of helpers are now obsolete and can be removed, so drivers can no longer start using them and instead use y2038-safe interfaces. Link: http://lkml.kernel.org/r/20200110154232.4104492-2-arnd@arndb.de Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: Deepa Dinamani <deepa.kernel@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent ca7e1fd commit 595abba

1 file changed

Lines changed: 0 additions & 37 deletions

File tree

‎include/linux/ktime.h‎

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -66,33 +66,15 @@ static inline ktime_t ktime_set(const s64 secs, const unsigned long nsecs)
6666
*/
6767
#define ktime_sub_ns(kt, nsval) ((kt) - (nsval))
6868

69-
/* convert a timespec to ktime_t format: */
70-
static inline ktime_t timespec_to_ktime(struct timespec ts)
71-
{
72-
return ktime_set(ts.tv_sec, ts.tv_nsec);
73-
}
74-
7569
/* convert a timespec64 to ktime_t format: */
7670
static inline ktime_t timespec64_to_ktime(struct timespec64 ts)
7771
{
7872
return ktime_set(ts.tv_sec, ts.tv_nsec);
7973
}
8074

81-
/* convert a timeval to ktime_t format: */
82-
static inline ktime_t timeval_to_ktime(struct timeval tv)
83-
{
84-
return ktime_set(tv.tv_sec, tv.tv_usec * NSEC_PER_USEC);
85-
}
86-
87-
/* Map the ktime_t to timespec conversion to ns_to_timespec function */
88-
#define ktime_to_timespec(kt) ns_to_timespec((kt))
89-
9075
/* Map the ktime_t to timespec conversion to ns_to_timespec function */
9176
#define ktime_to_timespec64(kt) ns_to_timespec64((kt))
9277

93-
/* Map the ktime_t to timeval conversion to ns_to_timeval function */
94-
#define ktime_to_timeval(kt) ns_to_timeval((kt))
95-
9678
/* Convert ktime_t to nanoseconds */
9779
static inline s64 ktime_to_ns(const ktime_t kt)
9880
{
@@ -215,25 +197,6 @@ static inline ktime_t ktime_sub_ms(const ktime_t kt, const u64 msec)
215197

216198
extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs);
217199

218-
/**
219-
* ktime_to_timespec_cond - convert a ktime_t variable to timespec
220-
* format only if the variable contains data
221-
* @kt: the ktime_t variable to convert
222-
* @ts: the timespec variable to store the result in
223-
*
224-
* Return: %true if there was a successful conversion, %false if kt was 0.
225-
*/
226-
static inline __must_check bool ktime_to_timespec_cond(const ktime_t kt,
227-
struct timespec *ts)
228-
{
229-
if (kt) {
230-
*ts = ktime_to_timespec(kt);
231-
return true;
232-
} else {
233-
return false;
234-
}
235-
}
236-
237200
/**
238201
* ktime_to_timespec64_cond - convert a ktime_t variable to timespec64
239202
* format only if the variable contains data

0 commit comments

Comments
 (0)