public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] clocksource/drivers/jcore: Use request_percpu_irq()
@ 2024-09-02 10:48 Uros Bizjak
  2024-09-02 12:53 ` Daniel Lezcano
  2024-09-06 18:56 ` [tip: timers/core] " tip-bot2 for Uros Bizjak
  0 siblings, 2 replies; 3+ messages in thread
From: Uros Bizjak @ 2024-09-02 10:48 UTC (permalink / raw)
  To: linux-kernel; +Cc: Uros Bizjak, Daniel Lezcano, Thomas Gleixner, Rich Felker

Use request_percpu_irq() instead of request_irq() to solve
the following sparse warning:

jcore-pit.c:173:40: warning: incorrect type in argument 5 (different address spaces)
jcore-pit.c:173:40:    expected void *dev
jcore-pit.c:173:40:    got struct jcore_pit [noderef] __percpu *static [assigned] [toplevel] jcore_pit_percpu

Compile tested only.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Rich Felker <dalias@libc.org>
---
v2: Also remove this_cpu_ptr() from jcore_timer_interrupt().
---
 drivers/clocksource/jcore-pit.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/clocksource/jcore-pit.c b/drivers/clocksource/jcore-pit.c
index a4a991101fa3..a3fe98cd3838 100644
--- a/drivers/clocksource/jcore-pit.c
+++ b/drivers/clocksource/jcore-pit.c
@@ -120,7 +120,7 @@ static int jcore_pit_local_init(unsigned cpu)
 
 static irqreturn_t jcore_timer_interrupt(int irq, void *dev_id)
 {
-	struct jcore_pit *pit = this_cpu_ptr(dev_id);
+	struct jcore_pit *pit = dev_id;
 
 	if (clockevent_state_oneshot(&pit->ced))
 		jcore_pit_disable(pit);
@@ -168,9 +168,8 @@ static int __init jcore_pit_init(struct device_node *node)
 		return -ENOMEM;
 	}
 
-	err = request_irq(pit_irq, jcore_timer_interrupt,
-			  IRQF_TIMER | IRQF_PERCPU,
-			  "jcore_pit", jcore_pit_percpu);
+	err = request_percpu_irq(pit_irq, jcore_timer_interrupt,
+				 "jcore_pit", jcore_pit_percpu);
 	if (err) {
 		pr_err("pit irq request failed: %d\n", err);
 		free_percpu(jcore_pit_percpu);
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-06 18:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-02 10:48 [PATCH v2] clocksource/drivers/jcore: Use request_percpu_irq() Uros Bizjak
2024-09-02 12:53 ` Daniel Lezcano
2024-09-06 18:56 ` [tip: timers/core] " tip-bot2 for Uros Bizjak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox