Skip to content

Commit

Permalink
LinnuxKPI: drm2: retire timespec_to_jiffies()
Browse files Browse the repository at this point in the history
Linux has removed timespec_to_jiffies() half a decade ago [1].
I cannot find any use of it anymore in recent drm-kmod branches
or in the tree so retire it.

While here also retire it from drm2.

Reported by:	emaste (D48318) [1].
Sponsored by:	The freeBSD Foundation
MFC after:	2 weeks
Reviewed by:	emaste, dumbbell (tested all drm-kmod versions, thanks!)
Differential Revision: https://reviews.freebsd.org/D48379
  • Loading branch information
Bjoern A. Zeeb authored and Bjoern A. Zeeb committed Feb 1, 2025
1 parent 94e6c8d commit 95ea57c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
13 changes: 0 additions & 13 deletions sys/compat/linuxkpi/common/include/linux/jiffies.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,6 @@ extern uint64_t lkpi_msec2hz_rem;
extern uint64_t lkpi_msec2hz_div;
extern uint64_t lkpi_msec2hz_max;

static inline int
timespec_to_jiffies(const struct timespec *ts)
{
u64 result;

result = ((u64)hz * ts->tv_sec) +
(((u64)hz * ts->tv_nsec + NSEC_PER_SEC - 1) / NSEC_PER_SEC);
if (result > MAX_JIFFY_OFFSET)
result = MAX_JIFFY_OFFSET;

return ((int)result);
}

static inline int
msecs_to_jiffies(uint64_t msec)
{
Expand Down
1 change: 0 additions & 1 deletion sys/dev/drm2/drm_os_freebsd.h
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@ extern unsigned long drm_linux_timer_hz_mask;
#define jiffies ticks
#define jiffies_to_msecs(x) (((int64_t)(x)) * 1000 / hz)
#define msecs_to_jiffies(x) (((int64_t)(x)) * hz / 1000)
#define timespec_to_jiffies(x) (((x)->tv_sec * 1000000 + (x)->tv_nsec) * hz / 1000000)
#define time_after(a,b) ((long)(b) - (long)(a) < 0)
#define time_after_eq(a,b) ((long)(b) - (long)(a) <= 0)
#define round_jiffies(j) ((unsigned long)(((j) + drm_linux_timer_hz_mask) & ~drm_linux_timer_hz_mask))
Expand Down

0 comments on commit 95ea57c

Please sign in to comment.