]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
netdev: Switch to use hrtimer_setup()
authorNam Cao <namcao@linutronix.de>
Wed, 5 Feb 2025 10:43:21 +0000 (11:43 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 18 Feb 2025 09:35:44 +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/861d9b287f2b5206b853dbcc0f302127f2a7f8ac.1738746872.git.namcao@linutronix.de
net/core/dev.c

index b91658e8aedb41de57c0b6531183c454ed770b2b..1ad2ca4d2116909269c08c15de24c726316ab177 100644 (file)
@@ -6931,8 +6931,7 @@ void netif_napi_add_weight_locked(struct net_device *dev,
 
        INIT_LIST_HEAD(&napi->poll_list);
        INIT_HLIST_NODE(&napi->napi_hash_node);
-       hrtimer_init(&napi->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_PINNED);
-       napi->timer.function = napi_watchdog;
+       hrtimer_setup(&napi->timer, napi_watchdog, CLOCK_MONOTONIC, HRTIMER_MODE_REL_PINNED);
        init_gro_hash(napi);
        napi->skb = NULL;
        INIT_LIST_HEAD(&napi->rx_list);