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

wifi: 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.

Patch was created by using Coccinelle.

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

authored by

Nam Cao and committed by
Thomas Gleixner
cbe2691b d1ba5752

+4 -6
+2 -2
drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c
··· 264 264 }; 265 265 dev->beacon_ops = &beacon_ops; 266 266 267 - hrtimer_init(&dev->pre_tbtt_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 268 - dev->pre_tbtt_timer.function = mt76x02u_pre_tbtt_interrupt; 267 + hrtimer_setup(&dev->pre_tbtt_timer, mt76x02u_pre_tbtt_interrupt, CLOCK_MONOTONIC, 268 + HRTIMER_MODE_REL); 269 269 INIT_WORK(&dev->pre_tbtt_work, mt76x02u_pre_tbtt_work); 270 270 271 271 mt76x02_init_beacon_config(dev);
+2 -4
drivers/net/wireless/virtual/mac80211_hwsim.c
··· 5548 5548 wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST); 5549 5549 5550 5550 for (i = 0; i < ARRAY_SIZE(data->link_data); i++) { 5551 - hrtimer_init(&data->link_data[i].beacon_timer, CLOCK_MONOTONIC, 5552 - HRTIMER_MODE_ABS_SOFT); 5553 - data->link_data[i].beacon_timer.function = 5554 - mac80211_hwsim_beacon; 5551 + hrtimer_setup(&data->link_data[i].beacon_timer, mac80211_hwsim_beacon, 5552 + CLOCK_MONOTONIC, HRTIMER_MODE_ABS_SOFT); 5555 5553 data->link_data[i].link_id = i; 5556 5554 } 5557 5555