]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
virtio: mem: Switch to use hrtimer_setup()
authorNam Cao <namcao@linutronix.de>
Wed, 5 Feb 2025 10:46:29 +0000 (11:46 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 18 Feb 2025 10:19:07 +0000 (11:19 +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.

Signed-off-by: Nam Cao <namcao@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://lore.kernel.org/all/4a911503d16684592b59a16d8ade97e42df64a54.1738746904.git.namcao@linutronix.de
drivers/virtio/virtio_mem.c

index 8a294b9cbcf68c3f360f75e672970e4c5d240052..56d0dbe621637cb4be1d134222c287f3cdd8e921 100644 (file)
@@ -2950,8 +2950,8 @@ static int virtio_mem_probe(struct virtio_device *vdev)
        mutex_init(&vm->hotplug_mutex);
        INIT_LIST_HEAD(&vm->next);
        spin_lock_init(&vm->removal_lock);
-       hrtimer_init(&vm->retry_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
-       vm->retry_timer.function = virtio_mem_timer_expired;
+       hrtimer_setup(&vm->retry_timer, virtio_mem_timer_expired, CLOCK_MONOTONIC,
+                     HRTIMER_MODE_REL);
        vm->retry_timer_ms = VIRTIO_MEM_RETRY_TIMER_MIN_MS;
        vm->in_kdump = is_kdump_kernel();