From: Advait Dhamorikar <advaitdhamorikar@gmail.com>
To: Thomas Gleixner <tglx@linutronix.de>,
Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Cc: linux-kernel@vger.kernel.org, skhan@linuxfoundation.org,
anupnewsmail@gmail.com,
Advait Dhamorikar <advaitdhamorikar@gmail.com>
Subject: [PATCH-next] irqchip/renesas-rzv2h: Fix potentially mismatched datatype
Date: Fri, 1 Nov 2024 01:06:06 +0530 [thread overview]
Message-ID: <20241031193606.87970-1-advaitdhamorikar@gmail.com> (raw)
This patch updates the type of hw_irq to unsigned long to
match irq_hw_number_t.
The variable hw_irq is defined as unsigned int at places,
However when it is initialized using irqd_to_hwirq(), it returns
an irq_hw_number_t, which inturn is a typedef for unsigned long.
Signed-off-by: Advait Dhamorikar <advaitdhamorikar@gmail.com>
---
drivers/irqchip/irq-renesas-rzv2h.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/irqchip/irq-renesas-rzv2h.c b/drivers/irqchip/irq-renesas-rzv2h.c
index fe2d29e91026..f7f27ee5c732 100644
--- a/drivers/irqchip/irq-renesas-rzv2h.c
+++ b/drivers/irqchip/irq-renesas-rzv2h.c
@@ -102,7 +102,7 @@ static inline struct rzv2h_icu_priv *irq_data_to_priv(struct irq_data *data)
static void rzv2h_icu_eoi(struct irq_data *d)
{
struct rzv2h_icu_priv *priv = irq_data_to_priv(d);
- unsigned int hw_irq = irqd_to_hwirq(d);
+ unsigned long hw_irq = irqd_to_hwirq(d);
unsigned int tintirq_nr;
u32 bit;
@@ -128,7 +128,7 @@ static void rzv2h_icu_eoi(struct irq_data *d)
static void rzv2h_tint_irq_endisable(struct irq_data *d, bool enable)
{
struct rzv2h_icu_priv *priv = irq_data_to_priv(d);
- unsigned int hw_irq = irqd_to_hwirq(d);
+ unsigned long hw_irq = irqd_to_hwirq(d);
u32 tint_nr, tssel_n, k, tssr;
if (hw_irq < ICU_TINT_START)
@@ -184,7 +184,7 @@ static int rzv2h_nmi_set_type(struct irq_data *d, unsigned int type)
static void rzv2h_clear_irq_int(struct rzv2h_icu_priv *priv, unsigned int hwirq)
{
- unsigned int irq_nr = hwirq - ICU_IRQ_START;
+ unsigned long irq_nr = hwirq - ICU_IRQ_START;
u32 isctr, iitsr, iitsel;
u32 bit = BIT(irq_nr);
@@ -204,8 +204,8 @@ static void rzv2h_clear_irq_int(struct rzv2h_icu_priv *priv, unsigned int hwirq)
static int rzv2h_irq_set_type(struct irq_data *d, unsigned int type)
{
struct rzv2h_icu_priv *priv = irq_data_to_priv(d);
- unsigned int hwirq = irqd_to_hwirq(d);
- u32 irq_nr = hwirq - ICU_IRQ_START;
+ unsigned long hwirq = irqd_to_hwirq(d);
+ unsigned long irq_nr = hwirq - ICU_IRQ_START;
u32 iitsr, sense;
switch (type & IRQ_TYPE_SENSE_MASK) {
@@ -241,7 +241,7 @@ static int rzv2h_irq_set_type(struct irq_data *d, unsigned int type)
static void rzv2h_clear_tint_int(struct rzv2h_icu_priv *priv, unsigned int hwirq)
{
- unsigned int tint_nr = hwirq - ICU_TINT_START;
+ unsigned long tint_nr = hwirq - ICU_TINT_START;
int titsel_n = ICU_TITSR_TITSEL_N(tint_nr);
u32 tsctr, titsr, titsel;
u32 bit = BIT(tint_nr);
@@ -265,9 +265,9 @@ static int rzv2h_tint_set_type(struct irq_data *d, unsigned int type)
u32 titsr, titsr_k, titsel_n, tien;
struct rzv2h_icu_priv *priv;
u32 tssr, tssr_k, tssel_n;
- unsigned int hwirq;
+ unsigned long hwirq;
u32 tint, sense;
- int tint_nr;
+ unsigned long tint_nr;
switch (type & IRQ_TYPE_SENSE_MASK) {
case IRQ_TYPE_LEVEL_LOW:
@@ -329,7 +329,7 @@ static int rzv2h_tint_set_type(struct irq_data *d, unsigned int type)
static int rzv2h_icu_set_type(struct irq_data *d, unsigned int type)
{
- unsigned int hw_irq = irqd_to_hwirq(d);
+ unsigned long hw_irq = irqd_to_hwirq(d);
int ret;
if (hw_irq >= ICU_TINT_START)
--
2.34.1
next reply other threads:[~2024-10-31 19:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-31 19:36 Advait Dhamorikar [this message]
2024-10-31 21:24 ` Thomas Gleixner
2024-11-01 6:44 ` Advait Dhamorikar
2024-11-01 9:48 ` Fabrizio Castro
2024-11-01 10:18 ` Advait Dhamorikar
2024-11-01 6:23 ` Jiri Slaby
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=20241031193606.87970-1-advaitdhamorikar@gmail.com \
--to=advaitdhamorikar@gmail.com \
--cc=anupnewsmail@gmail.com \
--cc=fabrizio.castro.jz@renesas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=skhan@linuxfoundation.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®