From: Peter Maydell <peter.maydell@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-devel@nongnu.org,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
Rob Herring <robh@kernel.org>,
qemu-arm@nongnu.org, Alistair Francis <alistair@alistair23.me>,
Igor Mitsyanko <i.mitsyanko@gmail.com>
Subject: Re: [PATCH 1/8] hw/arm/exynos4210: Replace magic 32 by proper 'GIC_INTERNAL' definition
Date: Tue, 4 Feb 2025 14:06:37 +0000 [thread overview]
Message-ID: <CAFEAcA__sgLzm6XQZEkw2suXMyLqRzj5N1Kh=ZL5r6p-__AKnQ@mail.gmail.com> (raw)
In-Reply-To: <20250130182441.40480-2-philmd@linaro.org>
On Thu, 30 Jan 2025 at 18:25, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> The 32 IRQ lines skipped are the GIC internal ones.
> Use the GIC_INTERNAL definition for clarity.
> No logical change.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/arm/exynos4210.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c
> index dd0edc81d5c..99b05a175d6 100644
> --- a/hw/arm/exynos4210.c
> +++ b/hw/arm/exynos4210.c
> @@ -393,8 +393,9 @@ static void exynos4210_init_board_irqs(Exynos4210State *s)
> }
> }
> if (irq_id) {
> + irq_id -= GIC_INTERNAL;
> qdev_connect_gpio_out(splitter, splitin,
> - qdev_get_gpio_in(extgicdev, irq_id - 32));
> + qdev_get_gpio_in(extgicdev, irq_id));
> }
> }
> for (; n < EXYNOS4210_MAX_INT_COMBINER_IN_IRQ; n++) {
> @@ -413,6 +414,7 @@ static void exynos4210_init_board_irqs(Exynos4210State *s)
> }
>
> if (irq_id) {
> + irq_id -= GIC_INTERNAL;
> assert(splitcount < EXYNOS4210_NUM_SPLITTERS);
> splitter = DEVICE(&s->splitter[splitcount]);
> qdev_prop_set_uint16(splitter, "num-lines", 2);
> @@ -421,7 +423,7 @@ static void exynos4210_init_board_irqs(Exynos4210State *s)
> s->irq_table[n] = qdev_get_gpio_in(splitter, 0);
> qdev_connect_gpio_out(splitter, 0, qdev_get_gpio_in(intcdev, n));
> qdev_connect_gpio_out(splitter, 1,
> - qdev_get_gpio_in(extgicdev, irq_id - 32));
> + qdev_get_gpio_in(extgicdev, irq_id));
> } else {
> s->irq_table[n] = qdev_get_gpio_in(intcdev, n);
A small nit, but I think I would prefer these as
irq_id - GIC_INTERNAL, rather than changing the value of the variable.
Otherwise the semantics of the value in the variable change
mid-way. That doesn't have a practical effect since the call
to qdev_get_gpio_in() is in both places that last use of the
variable, but I think it's a bit confusing.
thanks
-- PMM
next prev parent reply other threads:[~2025-02-04 14:07 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-30 18:24 [PATCH 0/8] hw/arm: Explicit number of GIC external IRQs for Cortex A9/A15 MPCore Philippe Mathieu-Daudé
2025-01-30 18:24 ` [PATCH 1/8] hw/arm/exynos4210: Replace magic 32 by proper 'GIC_INTERNAL' definition Philippe Mathieu-Daudé
2025-02-04 14:06 ` Peter Maydell [this message]
2025-01-30 18:24 ` [PATCH 2/8] hw/arm/exynos4210: Explicit number of GIC external IRQs Philippe Mathieu-Daudé
2025-01-30 18:30 ` Peter Maydell
2025-01-30 19:39 ` Philippe Mathieu-Daudé
2025-01-30 18:24 ` [PATCH 3/8] hw/arm/realview: " Philippe Mathieu-Daudé
2025-01-30 18:36 ` Peter Maydell
2025-02-12 14:58 ` Philippe Mathieu-Daudé
2025-01-30 18:24 ` [PATCH 4/8] hw/arm/xilinx_zynq: Replace IRQ_OFFSET -> GIC_INTERNAL Philippe Mathieu-Daudé
2025-02-04 14:07 ` Peter Maydell
2025-01-30 18:24 ` [PATCH 5/8] hw/arm/xilinx_zynq: Explicit number of GIC external IRQs Philippe Mathieu-Daudé
2025-01-30 18:24 ` [PATCH 6/8] hw/arm/vexpress: " Philippe Mathieu-Daudé
2025-01-30 18:24 ` [PATCH 7/8] hw/arm/highbank: " Philippe Mathieu-Daudé
2025-01-30 18:24 ` [PATCH 8/8] hw/cpu/arm_mpcore: Remove default values for " Philippe Mathieu-Daudé
2025-02-04 14:13 ` Peter Maydell
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='CAFEAcA__sgLzm6XQZEkw2suXMyLqRzj5N1Kh=ZL5r6p-__AKnQ@mail.gmail.com' \
--to=peter.maydell@linaro.org \
--cc=alistair@alistair23.me \
--cc=edgar.iglesias@gmail.com \
--cc=i.mitsyanko@gmail.com \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=robh@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).