From: Jiri Slaby <jirislaby@kernel.org>
To: Advait Dhamorikar <advaitdhamorikar@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>,
Fabrizio Castro <fabrizio.castro.jz@renesas.com>
Cc: linux-kernel@vger.kernel.org, skhan@linuxfoundation.org,
anupnewsmail@gmail.com
Subject: Re: [PATCH-next] irqchip/renesas-rzv2h: Fix potentially mismatched datatype
Date: Fri, 1 Nov 2024 07:23:43 +0100 [thread overview]
Message-ID: <a006de4d-46bc-442d-9f8e-92e5d219b8b9@kernel.org> (raw)
In-Reply-To: <20241031193606.87970-1-advaitdhamorikar@gmail.com>
Hi,
On 31. 10. 24, 20:36, Advait Dhamorikar wrote:
> 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.
"in turn"
But what's the purpose of this? First, why wouldn't you use
irq_hw_number_t then?
Nevertheless, the HW does not support hw irqs > uint (it supports
1+16+32, actually). So why all this in the first place?
> @@ -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;
Switching tint_nr to unsigned might still be a good thing to avoid weird
signed overflows in the future. But I don't think it warrants for a patch...
thanks,
--
js
suse labs
prev parent reply other threads:[~2024-11-01 6:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-31 19:36 Advait Dhamorikar
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 [this message]
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=a006de4d-46bc-442d-9f8e-92e5d219b8b9@kernel.org \
--to=jirislaby@kernel.org \
--cc=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®