Skip to content

Commit 81cb7c4

Browse files
Bjoern A. ZeebBjoern A. Zeeb
authored andcommitted
LinuxKPI: rename from_timer() to timer_container_of()
With Linux 6.16 from_timer() got renamed to timer_container_of(); add the LINUXKPI_VERSION check with a default to the current version. Update all in-tree consumers (apart from wireless drivers managed otherwise). Sponsored by: The FreeBSD Foundation (initially) MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D52073
1 parent c1264b6 commit 81cb7c4

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,13 @@ extern unsigned long linux_timer_hz_mask;
4949

5050
#define TIMER_IRQSAFE 0x0001
5151

52+
#if defined(LINUXKPI_VERSION) && (LINUXKPI_VERSION < 61600)
5253
#define from_timer(var, arg, field) \
5354
container_of(arg, typeof(*(var)), field)
55+
#else
56+
#define timer_container_of(var, arg, field) \
57+
container_of(arg, typeof(*(var)), field)
58+
#endif
5459

5560
#define timer_setup(timer, func, flags) do { \
5661
CTASSERT(((flags) & ~TIMER_IRQSAFE) == 0); \

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7814,7 +7814,7 @@ lkpi_wiphy_delayed_work_timer(struct timer_list *tl)
78147814
{
78157815
struct wiphy_delayed_work *wdwk;
78167816

7817-
wdwk = from_timer(wdwk, tl, timer);
7817+
wdwk = timer_container_of(wdwk, tl, timer);
78187818
wiphy_work_queue(wdwk->wiphy, &wdwk->work);
78197819
}
78207820

sys/dev/irdma/irdma_cm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,7 @@ irdma_cm_timer_tick(struct timer_list *t)
13161316
struct irdma_timer_entry *send_entry, *close_entry;
13171317
struct list_head *list_core_temp;
13181318
struct list_head *list_node;
1319-
struct irdma_cm_core *cm_core = from_timer(cm_core, t, tcp_timer);
1319+
struct irdma_cm_core *cm_core = timer_container_of(cm_core, t, tcp_timer);
13201320
struct irdma_sc_vsi *vsi;
13211321
u32 settimer = 0;
13221322
unsigned long timetosend;

sys/dev/irdma/irdma_utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ irdma_terminate_done(struct irdma_sc_qp *qp, int timeout_occurred)
876876
static void
877877
irdma_terminate_timeout(struct timer_list *t)
878878
{
879-
struct irdma_qp *iwqp = from_timer(iwqp, t, terminate_timer);
879+
struct irdma_qp *iwqp = timer_container_of(iwqp, t, terminate_timer);
880880
struct irdma_sc_qp *qp = &iwqp->sc_qp;
881881

882882
irdma_terminate_done(qp, 1);
@@ -1528,7 +1528,7 @@ static void
15281528
irdma_hw_stats_timeout(struct timer_list *t)
15291529
{
15301530
struct irdma_vsi_pestat *pf_devstat =
1531-
from_timer(pf_devstat, t, stats_timer);
1531+
timer_container_of(pf_devstat, t, stats_timer);
15321532
struct irdma_sc_vsi *sc_vsi = pf_devstat->vsi;
15331533

15341534
if (sc_vsi->dev->hw_attrs.uk_attrs.hw_rev >= IRDMA_GEN_2)

sys/dev/qat/qat_common/adf_gen4_timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ adf_hb_irq_bh_handler(struct work_struct *work)
5757
static void
5858
timer_handler(struct timer_list *tl)
5959
{
60-
struct adf_int_timer *int_timer = from_timer(int_timer, tl, timer);
60+
struct adf_int_timer *int_timer = timer_container_of(int_timer, tl, timer);
6161
struct adf_accel_dev *accel_dev = int_timer->accel_dev;
6262
struct adf_hb_timer_data *hb_timer_data = NULL;
6363
u64 timeout_val = adf_get_next_timeout(int_timer->timeout_val);

0 commit comments

Comments
 (0)