* [tip: timers/cleanups] treewide: Convert new and leftover hrtimer_init() users
@ 2025-04-05 8:46 tip-bot2 for Thomas Gleixner
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Thomas Gleixner @ 2025-04-05 8:46 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Thomas Gleixner, Ingo Molnar, x86, linux-kernel
The following commit has been merged into the timers/cleanups branch of tip:
Commit-ID: 48ad7bbfd53af0d3fe6490a4dd30c169db6f12aa
Gitweb: https://git.kernel.org/tip/48ad7bbfd53af0d3fe6490a4dd30c169db6f12aa
Author: Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Fri, 04 Apr 2025 19:31:15 +02:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Sat, 05 Apr 2025 10:30:17 +02:00
treewide: Convert new and leftover hrtimer_init() users
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.
Coccinelle scripted cleanup.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
drivers/input/joystick/walkera0701.c | 3 +--
drivers/input/keyboard/gpio_keys.c | 10 ++++------
drivers/net/netdevsim/netdev.c | 4 ++--
drivers/pps/generators/pps_gen_tio.c | 4 ++--
4 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/drivers/input/joystick/walkera0701.c b/drivers/input/joystick/walkera0701.c
index 59eea81..15370fb 100644
--- a/drivers/input/joystick/walkera0701.c
+++ b/drivers/input/joystick/walkera0701.c
@@ -232,8 +232,7 @@ static void walkera0701_attach(struct parport *pp)
goto err_unregister_device;
}
- hrtimer_init(&w->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- w->timer.function = timer_handler;
+ hrtimer_setup(&w->timer, timer_handler, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
w->input_dev = input_allocate_device();
if (!w->input_dev) {
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 5eef665..5c39a21 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -590,9 +590,8 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
INIT_DELAYED_WORK(&bdata->work, gpio_keys_gpio_work_func);
- hrtimer_init(&bdata->debounce_timer,
- CLOCK_REALTIME, HRTIMER_MODE_REL);
- bdata->debounce_timer.function = gpio_keys_debounce_timer;
+ hrtimer_setup(&bdata->debounce_timer, gpio_keys_debounce_timer,
+ CLOCK_REALTIME, HRTIMER_MODE_REL);
isr = gpio_keys_gpio_isr;
irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;
@@ -628,9 +627,8 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
}
bdata->release_delay = button->debounce_interval;
- hrtimer_init(&bdata->release_timer,
- CLOCK_REALTIME, HRTIMER_MODE_REL_HARD);
- bdata->release_timer.function = gpio_keys_irq_timer;
+ hrtimer_setup(&bdata->release_timer, gpio_keys_irq_timer,
+ CLOCK_REALTIME, HRTIMER_MODE_REL_HARD);
isr = gpio_keys_irq_isr;
irqflags = 0;
diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c
index ddda0c1..0e0321a 100644
--- a/drivers/net/netdevsim/netdev.c
+++ b/drivers/net/netdevsim/netdev.c
@@ -441,8 +441,8 @@ static enum hrtimer_restart nsim_napi_schedule(struct hrtimer *timer)
static void nsim_rq_timer_init(struct nsim_rq *rq)
{
- hrtimer_init(&rq->napi_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- rq->napi_timer.function = nsim_napi_schedule;
+ hrtimer_setup(&rq->napi_timer, nsim_napi_schedule, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
}
static void nsim_enable_napi(struct netdevsim *ns)
diff --git a/drivers/pps/generators/pps_gen_tio.c b/drivers/pps/generators/pps_gen_tio.c
index 6c46b46..1d5ffe0 100644
--- a/drivers/pps/generators/pps_gen_tio.c
+++ b/drivers/pps/generators/pps_gen_tio.c
@@ -227,8 +227,8 @@ static int pps_gen_tio_probe(struct platform_device *pdev)
return PTR_ERR(tio->base);
pps_tio_disable(tio);
- hrtimer_init(&tio->timer, CLOCK_REALTIME, HRTIMER_MODE_ABS);
- tio->timer.function = hrtimer_callback;
+ hrtimer_setup(&tio->timer, hrtimer_callback, CLOCK_REALTIME,
+ HRTIMER_MODE_ABS);
spin_lock_init(&tio->lock);
platform_set_drvdata(pdev, &tio);
^ permalink raw reply [flat|nested] 2+ messages in thread
* [tip: timers/cleanups] treewide: Convert new and leftover hrtimer_init() users
@ 2025-04-04 17:54 tip-bot2 for Thomas Gleixner
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Thomas Gleixner @ 2025-04-04 17:54 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Thomas Gleixner, x86, linux-kernel
The following commit has been merged into the timers/cleanups branch of tip:
Commit-ID: f1a5271df2aa65b08f4dcdd1499e3cfc096be108
Gitweb: https://git.kernel.org/tip/f1a5271df2aa65b08f4dcdd1499e3cfc096be108
Author: Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Fri, 04 Apr 2025 19:31:15 +02:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Fri, 04 Apr 2025 19:46:06 +02:00
treewide: Convert new and leftover hrtimer_init() users
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.
Coccinelle scripted cleanup.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
drivers/input/joystick/walkera0701.c | 3 +--
drivers/input/keyboard/gpio_keys.c | 10 ++++------
drivers/net/netdevsim/netdev.c | 4 ++--
drivers/pps/generators/pps_gen_tio.c | 4 ++--
4 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/drivers/input/joystick/walkera0701.c b/drivers/input/joystick/walkera0701.c
index 59eea81..15370fb 100644
--- a/drivers/input/joystick/walkera0701.c
+++ b/drivers/input/joystick/walkera0701.c
@@ -232,8 +232,7 @@ static void walkera0701_attach(struct parport *pp)
goto err_unregister_device;
}
- hrtimer_init(&w->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- w->timer.function = timer_handler;
+ hrtimer_setup(&w->timer, timer_handler, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
w->input_dev = input_allocate_device();
if (!w->input_dev) {
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 5eef665..5c39a21 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -590,9 +590,8 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
INIT_DELAYED_WORK(&bdata->work, gpio_keys_gpio_work_func);
- hrtimer_init(&bdata->debounce_timer,
- CLOCK_REALTIME, HRTIMER_MODE_REL);
- bdata->debounce_timer.function = gpio_keys_debounce_timer;
+ hrtimer_setup(&bdata->debounce_timer, gpio_keys_debounce_timer,
+ CLOCK_REALTIME, HRTIMER_MODE_REL);
isr = gpio_keys_gpio_isr;
irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;
@@ -628,9 +627,8 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
}
bdata->release_delay = button->debounce_interval;
- hrtimer_init(&bdata->release_timer,
- CLOCK_REALTIME, HRTIMER_MODE_REL_HARD);
- bdata->release_timer.function = gpio_keys_irq_timer;
+ hrtimer_setup(&bdata->release_timer, gpio_keys_irq_timer,
+ CLOCK_REALTIME, HRTIMER_MODE_REL_HARD);
isr = gpio_keys_irq_isr;
irqflags = 0;
diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c
index b67af46..fd94690 100644
--- a/drivers/net/netdevsim/netdev.c
+++ b/drivers/net/netdevsim/netdev.c
@@ -441,8 +441,8 @@ static enum hrtimer_restart nsim_napi_schedule(struct hrtimer *timer)
static void nsim_rq_timer_init(struct nsim_rq *rq)
{
- hrtimer_init(&rq->napi_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- rq->napi_timer.function = nsim_napi_schedule;
+ hrtimer_setup(&rq->napi_timer, nsim_napi_schedule, CLOCK_MONOTONIC,
+ HRTIMER_MODE_REL);
}
static void nsim_enable_napi(struct netdevsim *ns)
diff --git a/drivers/pps/generators/pps_gen_tio.c b/drivers/pps/generators/pps_gen_tio.c
index 6c46b46..1d5ffe0 100644
--- a/drivers/pps/generators/pps_gen_tio.c
+++ b/drivers/pps/generators/pps_gen_tio.c
@@ -227,8 +227,8 @@ static int pps_gen_tio_probe(struct platform_device *pdev)
return PTR_ERR(tio->base);
pps_tio_disable(tio);
- hrtimer_init(&tio->timer, CLOCK_REALTIME, HRTIMER_MODE_ABS);
- tio->timer.function = hrtimer_callback;
+ hrtimer_setup(&tio->timer, hrtimer_callback, CLOCK_REALTIME,
+ HRTIMER_MODE_ABS);
spin_lock_init(&tio->lock);
platform_set_drvdata(pdev, &tio);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-04-05 8:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-05 8:46 [tip: timers/cleanups] treewide: Convert new and leftover hrtimer_init() users tip-bot2 for Thomas Gleixner
-- strict thread matches above, loose matches on Subject: below --
2025-04-04 17:54 tip-bot2 for Thomas Gleixner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®