Skip to content

Commit 5cb64a1

Browse files
Bjoern A. ZeebBjoern A. Zeeb
authored andcommitted
LinuxKPI: timer KPI *_timer -> timer_*
del_timer() got renamed to timer_delete() approximately in Linux 6.2 (similar for *_sync and likely others). Keep the old functions as compat; unclear when we can gc them. We should also re-define them with a linuxkpi_ prefix to avoid possible conflicts in the future if we do a full pass over this at some point. Sponsored by: The FreeBSD Foundation (intiially) MFC after: 3 days X-MFC; preserve symbols, not inline Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D52074
1 parent 81cb7c4 commit 5cb64a1

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

sys/compat/linuxkpi/common/include/linux/timer.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,23 @@ extern unsigned long linux_timer_hz_mask;
8484
extern int mod_timer(struct timer_list *, unsigned long);
8585
extern void add_timer(struct timer_list *);
8686
extern void add_timer_on(struct timer_list *, int cpu);
87-
extern int del_timer(struct timer_list *);
88-
extern int del_timer_sync(struct timer_list *);
87+
88+
extern int timer_delete(struct timer_list *);
8989
extern int timer_delete_sync(struct timer_list *);
9090
extern int timer_shutdown_sync(struct timer_list *);
9191

92+
static inline int
93+
del_timer(struct timer_list *tl)
94+
{
95+
return (timer_delete(tl));
96+
}
97+
98+
static inline int
99+
del_timer_sync(struct timer_list *tl)
100+
{
101+
return (timer_delete_sync(tl));
102+
}
103+
92104
#define timer_pending(timer) callout_pending(&(timer)->callout)
93105
#define round_jiffies(j) \
94106
((unsigned long)(((j) + linux_timer_hz_mask) & ~linux_timer_hz_mask))

sys/compat/linuxkpi/common/src/linux_compat.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2120,7 +2120,7 @@ add_timer_on(struct timer_list *timer, int cpu)
21202120
}
21212121

21222122
int
2123-
del_timer(struct timer_list *timer)
2123+
timer_delete(struct timer_list *timer)
21242124
{
21252125

21262126
if (callout_stop(&(timer)->callout) == -1)
@@ -2129,21 +2129,14 @@ del_timer(struct timer_list *timer)
21292129
}
21302130

21312131
int
2132-
del_timer_sync(struct timer_list *timer)
2132+
timer_delete_sync(struct timer_list *timer)
21332133
{
21342134

21352135
if (callout_drain(&(timer)->callout) == -1)
21362136
return (0);
21372137
return (1);
21382138
}
21392139

2140-
int
2141-
timer_delete_sync(struct timer_list *timer)
2142-
{
2143-
2144-
return (del_timer_sync(timer));
2145-
}
2146-
21472140
int
21482141
timer_shutdown_sync(struct timer_list *timer)
21492142
{

0 commit comments

Comments
 (0)