]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: Switch to use hrtimer_setup()
authorNam Cao <namcao@linutronix.de>
Wed, 5 Feb 2025 10:43:40 +0000 (11:43 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 18 Feb 2025 09:35:47 +0000 (10:35 +0100)
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
drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c
drivers/net/wireless/virtual/mac80211_hwsim.c

index 0e1ede9314d8f76c3dcba19161c8dec399eeeae1..4840d0b500b30a59cef8e468db78fe6e64e286d5 100644 (file)
@@ -264,8 +264,8 @@ void mt76x02u_init_beacon_config(struct mt76x02_dev *dev)
        };
        dev->beacon_ops = &beacon_ops;
 
-       hrtimer_init(&dev->pre_tbtt_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
-       dev->pre_tbtt_timer.function = mt76x02u_pre_tbtt_interrupt;
+       hrtimer_setup(&dev->pre_tbtt_timer, mt76x02u_pre_tbtt_interrupt, CLOCK_MONOTONIC,
+                     HRTIMER_MODE_REL);
        INIT_WORK(&dev->pre_tbtt_work, mt76x02u_pre_tbtt_work);
 
        mt76x02_init_beacon_config(dev);
index cf6a331d404271141f3e9a736feba1ad8cfead5a..fb187a9e984edea5ded83764dcfa6698b531ea63 100644 (file)
@@ -5548,10 +5548,8 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,
        wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
 
        for (i = 0; i < ARRAY_SIZE(data->link_data); i++) {
-               hrtimer_init(&data->link_data[i].beacon_timer, CLOCK_MONOTONIC,
-                            HRTIMER_MODE_ABS_SOFT);
-               data->link_data[i].beacon_timer.function =
-                       mac80211_hwsim_beacon;
+               hrtimer_setup(&data->link_data[i].beacon_timer, mac80211_hwsim_beacon,
+                             CLOCK_MONOTONIC, HRTIMER_MODE_ABS_SOFT);
                data->link_data[i].link_id = i;
        }