Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xfrm: Switch to use hrtimer_setup()

hrtimer_setup() takes the callback function pointer as argument and
initializes the timer completely.

Replace hrtimer_init() and the open coded initialization of
hrtimer::function with the new setup mechanism.

Signed-off-by: Nam Cao <namcao@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/d338b246f087ee2b2a305348c896449e107a7ff4.1738746872.git.namcao@linutronix.de

authored by

Nam Cao and committed by
Thomas Gleixner
1417c85d 7b449279

+4 -6
+2 -4
net/xfrm/xfrm_iptfs.c
··· 2625 2625 struct xfrm_iptfs_data *xtfs) 2626 2626 { 2627 2627 __skb_queue_head_init(&xtfs->queue); 2628 - hrtimer_init(&xtfs->iptfs_timer, CLOCK_MONOTONIC, IPTFS_HRTIMER_MODE); 2629 - xtfs->iptfs_timer.function = iptfs_delay_timer; 2628 + hrtimer_setup(&xtfs->iptfs_timer, iptfs_delay_timer, CLOCK_MONOTONIC, IPTFS_HRTIMER_MODE); 2630 2629 2631 2630 spin_lock_init(&xtfs->drop_lock); 2632 - hrtimer_init(&xtfs->drop_timer, CLOCK_MONOTONIC, IPTFS_HRTIMER_MODE); 2633 - xtfs->drop_timer.function = iptfs_drop_timer; 2631 + hrtimer_setup(&xtfs->drop_timer, iptfs_drop_timer, CLOCK_MONOTONIC, IPTFS_HRTIMER_MODE); 2634 2632 2635 2633 /* Modify type (esp) adjustment values */ 2636 2634
+2 -2
net/xfrm/xfrm_state.c
··· 746 746 INIT_HLIST_NODE(&x->bysrc); 747 747 INIT_HLIST_NODE(&x->byspi); 748 748 INIT_HLIST_NODE(&x->byseq); 749 - hrtimer_init(&x->mtimer, CLOCK_BOOTTIME, HRTIMER_MODE_ABS_SOFT); 750 - x->mtimer.function = xfrm_timer_handler; 749 + hrtimer_setup(&x->mtimer, xfrm_timer_handler, CLOCK_BOOTTIME, 750 + HRTIMER_MODE_ABS_SOFT); 751 751 timer_setup(&x->rtimer, xfrm_replay_timer_handler, 0); 752 752 x->curlft.add_time = ktime_get_real_seconds(); 753 753 x->lft.soft_byte_limit = XFRM_INF;