mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Uros Bizjak <ubizjak@gmail.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH] clocksource/timer-of: Add missing casts to percpu address space
Date: Mon, 19 Aug 2024 08:13:45 +0200	[thread overview]
Message-ID: <20240819061351.14782-1-ubizjak@gmail.com> (raw)

Add missing casts to percpu address space to fix

timer-of.c:29:46: warning: incorrect type in argument 2 (different address spaces)
timer-of.c:29:46:    expected void [noderef] __percpu *
timer-of.c:29:46:    got struct clock_event_device *clkevt
timer-of.c:74:51: warning: incorrect type in argument 4 (different address spaces)
timer-of.c:74:51:    expected void [noderef] __percpu *percpu_dev_id
timer-of.c:74:51:    got struct clock_event_device *clkevt

sparse warnings.

Found by GCC's named address space checks.

There were no changes in the resulting object file.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 drivers/clocksource/timer-of.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c
index c3f54d9912be..7e0375a804ff 100644
--- a/drivers/clocksource/timer-of.c
+++ b/drivers/clocksource/timer-of.c
@@ -26,7 +26,8 @@ static __init void timer_of_irq_exit(struct of_timer_irq *of_irq)
 	struct clock_event_device *clkevt = &to->clkevt;
 
 	if (of_irq->percpu)
-		free_percpu_irq(of_irq->irq, clkevt);
+		free_percpu_irq(of_irq->irq,
+				(void __percpu *)(unsigned long)clkevt);
 	else
 		free_irq(of_irq->irq, clkevt);
 }
@@ -70,8 +71,8 @@ static __init int timer_of_irq_init(struct device_node *np,
 	}
 
 	ret = of_irq->percpu ?
-		request_percpu_irq(of_irq->irq, of_irq->handler,
-				   np->full_name, clkevt) :
+		request_percpu_irq(of_irq->irq, of_irq->handler, np->full_name,
+				   (void __percpu *)(unsigned long)clkevt) :
 		request_irq(of_irq->irq, of_irq->handler,
 			    of_irq->flags ? of_irq->flags : IRQF_TIMER,
 			    np->full_name, clkevt);
-- 
2.46.0


             reply	other threads:[~2024-08-19  6:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-19  6:13 Uros Bizjak [this message]
2024-08-19  8:18 ` Daniel Lezcano
2024-08-19  8:31   ` Uros Bizjak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240819061351.14782-1-ubizjak@gmail.com \
    --to=ubizjak@gmail.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®