* [PATCH 0/3] irqchip/renesas-rzv2h: Cleanups
@ 2026-04-03 8:48 Geert Uytterhoeven
2026-04-03 8:48 ` [PATCH 1/3] irqchip/renesas-rzv2h: Kill swint_idx[] Geert Uytterhoeven
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2026-04-03 8:48 UTC (permalink / raw)
To: Thomas Gleixner, Lad Prabhakar, Biju Das
Cc: linux-renesas-soc, linux-kernel, Geert Uytterhoeven
Hi all,
This patch series contains some cleanups for the RZ/V2H interrupt
controller driver. It has been compile-tested only.
Thanks for your comments!
Geert Uytterhoeven (3):
irqchip/renesas-rzv2h: Kill swint_idx[]
irqchip/renesas-rzv2h: Kill swint_names[]
irqchip/renesas-rzv2h: Kill icu_err string
drivers/irqchip/irq-renesas-rzv2h.c | 29 ++++++++++-------------------
1 file changed, 10 insertions(+), 19 deletions(-)
--
2.43.0
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/3] irqchip/renesas-rzv2h: Kill swint_idx[]
2026-04-03 8:48 [PATCH 0/3] irqchip/renesas-rzv2h: Cleanups Geert Uytterhoeven
@ 2026-04-03 8:48 ` Geert Uytterhoeven
2026-04-03 9:10 ` Biju Das
2026-04-03 8:48 ` [PATCH 2/3] irqchip/renesas-rzv2h: Kill swint_names[] Geert Uytterhoeven
2026-04-03 8:48 ` [PATCH 3/3] irqchip/renesas-rzv2h: Kill icu_err string Geert Uytterhoeven
2 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2026-04-03 8:48 UTC (permalink / raw)
To: Thomas Gleixner, Lad Prabhakar, Biju Das
Cc: linux-renesas-soc, linux-kernel, Geert Uytterhoeven
The array swint_idx[] just contains an identity mapping.
Replace it by using the index directly, to simplify the code.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/irqchip/irq-renesas-rzv2h.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/irqchip/irq-renesas-rzv2h.c b/drivers/irqchip/irq-renesas-rzv2h.c
index ce790590f7ca9932..6fa8141adcaa59f2 100644
--- a/drivers/irqchip/irq-renesas-rzv2h.c
+++ b/drivers/irqchip/irq-renesas-rzv2h.c
@@ -745,7 +745,7 @@ static irqreturn_t rzv2h_icu_error_irq(int irq, void *data)
static irqreturn_t rzv2h_icu_swint_irq(int irq, void *data)
{
- u8 cpu = *(u8 *)data;
+ unsigned int cpu = (uintptr_t)data;
pr_info("SWINT interrupt for CA55 core %u\n", cpu);
return IRQ_HANDLED;
@@ -760,7 +760,6 @@ static int rzv2h_icu_setup_irqs(struct platform_device *pdev, struct irq_domain
"int-ca55-2", "int-ca55-3",
};
static const char *icu_err = "icu-error-ca55";
- static const u8 swint_idx[] = { 0, 1, 2, 3 };
void __iomem *base = rzv2h_icu_data->base;
struct device *dev = &pdev->dev;
struct irq_fwspec fwspec;
@@ -780,7 +779,7 @@ static int rzv2h_icu_setup_irqs(struct platform_device *pdev, struct irq_domain
}
ret = devm_request_irq(dev, virq, rzv2h_icu_swint_irq, 0, dev_name(dev),
- (void *)&swint_idx[i]);
+ (void *)(uintptr_t)i);
if (ret) {
return dev_err_probe(dev, ret, "Failed to request %s IRQ\n",
rzv2h_swint_names[i]);
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/3] irqchip/renesas-rzv2h: Kill swint_names[]
2026-04-03 8:48 [PATCH 0/3] irqchip/renesas-rzv2h: Cleanups Geert Uytterhoeven
2026-04-03 8:48 ` [PATCH 1/3] irqchip/renesas-rzv2h: Kill swint_idx[] Geert Uytterhoeven
@ 2026-04-03 8:48 ` Geert Uytterhoeven
2026-04-03 9:11 ` Biju Das
2026-04-03 8:48 ` [PATCH 3/3] irqchip/renesas-rzv2h: Kill icu_err string Geert Uytterhoeven
2 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2026-04-03 8:48 UTC (permalink / raw)
To: Thomas Gleixner, Lad Prabhakar, Biju Das
Cc: linux-renesas-soc, linux-kernel, Geert Uytterhoeven
The array swint_names[] just contains expansions of "int-ca55-%u".
Replace it by formatting the strings where needed, to improve
readability.
Despite the two error messages can no longer be shared with the ICU
error cases, this reduces generated code size by 56 bytes.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
---
drivers/irqchip/irq-renesas-rzv2h.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/drivers/irqchip/irq-renesas-rzv2h.c b/drivers/irqchip/irq-renesas-rzv2h.c
index 6fa8141adcaa59f2..d075196bdc741c7f 100644
--- a/drivers/irqchip/irq-renesas-rzv2h.c
+++ b/drivers/irqchip/irq-renesas-rzv2h.c
@@ -755,10 +755,6 @@ static int rzv2h_icu_setup_irqs(struct platform_device *pdev, struct irq_domain
{
const struct rzv2h_hw_info *hw_info = rzv2h_icu_data->info;
bool irq_inject = IS_ENABLED(CONFIG_GENERIC_IRQ_INJECTION);
- static const char * const rzv2h_swint_names[] = {
- "int-ca55-0", "int-ca55-1",
- "int-ca55-2", "int-ca55-3",
- };
static const char *icu_err = "icu-error-ca55";
void __iomem *base = rzv2h_icu_data->base;
struct device *dev = &pdev->dev;
@@ -774,16 +770,14 @@ static int rzv2h_icu_setup_irqs(struct platform_device *pdev, struct irq_domain
virq = irq_create_fwspec_mapping(&fwspec);
if (!virq) {
- return dev_err_probe(dev, -EINVAL, "failed to create IRQ mapping for %s\n",
- rzv2h_swint_names[i]);
+ return dev_err_probe(dev, -EINVAL,
+ "failed to create int-ca55-%u IRQ mapping\n", i);
}
ret = devm_request_irq(dev, virq, rzv2h_icu_swint_irq, 0, dev_name(dev),
(void *)(uintptr_t)i);
- if (ret) {
- return dev_err_probe(dev, ret, "Failed to request %s IRQ\n",
- rzv2h_swint_names[i]);
- }
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to request int-ca55-%u IRQ\n", i);
}
/* Unmask and clear all IP/CA55 error interrupts */
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/3] irqchip/renesas-rzv2h: Kill icu_err string
2026-04-03 8:48 [PATCH 0/3] irqchip/renesas-rzv2h: Cleanups Geert Uytterhoeven
2026-04-03 8:48 ` [PATCH 1/3] irqchip/renesas-rzv2h: Kill swint_idx[] Geert Uytterhoeven
2026-04-03 8:48 ` [PATCH 2/3] irqchip/renesas-rzv2h: Kill swint_names[] Geert Uytterhoeven
@ 2026-04-03 8:48 ` Geert Uytterhoeven
2 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2026-04-03 8:48 UTC (permalink / raw)
To: Thomas Gleixner, Lad Prabhakar, Biju Das
Cc: linux-renesas-soc, linux-kernel, Geert Uytterhoeven
Replace the string variable icu_err by its expanded value where needed,
to improve readability.
This reduces generated code size by 16 bytes.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/irqchip/irq-renesas-rzv2h.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/irqchip/irq-renesas-rzv2h.c b/drivers/irqchip/irq-renesas-rzv2h.c
index d075196bdc741c7f..1633b118731f925f 100644
--- a/drivers/irqchip/irq-renesas-rzv2h.c
+++ b/drivers/irqchip/irq-renesas-rzv2h.c
@@ -755,7 +755,6 @@ static int rzv2h_icu_setup_irqs(struct platform_device *pdev, struct irq_domain
{
const struct rzv2h_hw_info *hw_info = rzv2h_icu_data->info;
bool irq_inject = IS_ENABLED(CONFIG_GENERIC_IRQ_INJECTION);
- static const char *icu_err = "icu-error-ca55";
void __iomem *base = rzv2h_icu_data->base;
struct device *dev = &pdev->dev;
struct irq_fwspec fwspec;
@@ -800,14 +799,13 @@ static int rzv2h_icu_setup_irqs(struct platform_device *pdev, struct irq_domain
fwspec.param[1] = IRQ_TYPE_LEVEL_HIGH;
virq = irq_create_fwspec_mapping(&fwspec);
- if (!virq) {
- return dev_err_probe(dev, -EINVAL, "failed to create IRQ mapping for %s\n",
- icu_err);
- }
+ if (!virq)
+ return dev_err_probe(dev, -EINVAL,
+ "failed to create icu-error-ca55 IRQ mapping\n");
ret = devm_request_irq(dev, virq, rzv2h_icu_error_irq, 0, dev_name(dev), rzv2h_icu_data);
if (ret)
- return dev_err_probe(dev, ret, "Failed to request %s IRQ\n", icu_err);
+ return dev_err_probe(dev, ret, "Failed to request icu-error-ca55 IRQ\n");
return 0;
}
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH 1/3] irqchip/renesas-rzv2h: Kill swint_idx[]
2026-04-03 8:48 ` [PATCH 1/3] irqchip/renesas-rzv2h: Kill swint_idx[] Geert Uytterhoeven
@ 2026-04-03 9:10 ` Biju Das
0 siblings, 0 replies; 6+ messages in thread
From: Biju Das @ 2026-04-03 9:10 UTC (permalink / raw)
To: Geert Uytterhoeven, Thomas Gleixner, Prabhakar Mahadev Lad
Cc: linux-renesas-soc, linux-kernel
Hi Geert,
Thanks for the patch.
> -----Original Message-----
> From: Geert Uytterhoeven <geert+renesas@glider.be>
> Sent: 03 April 2026 09:48
> Subject: [PATCH 1/3] irqchip/renesas-rzv2h: Kill swint_idx[]
>
> The array swint_idx[] just contains an identity mapping.
> Replace it by using the index directly, to simplify the code.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Cheers,
Biju
> ---
> drivers/irqchip/irq-renesas-rzv2h.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/irqchip/irq-renesas-rzv2h.c b/drivers/irqchip/irq-renesas-rzv2h.c
> index ce790590f7ca9932..6fa8141adcaa59f2 100644
> --- a/drivers/irqchip/irq-renesas-rzv2h.c
> +++ b/drivers/irqchip/irq-renesas-rzv2h.c
> @@ -745,7 +745,7 @@ static irqreturn_t rzv2h_icu_error_irq(int irq, void *data)
>
> static irqreturn_t rzv2h_icu_swint_irq(int irq, void *data) {
> - u8 cpu = *(u8 *)data;
> + unsigned int cpu = (uintptr_t)data;
>
> pr_info("SWINT interrupt for CA55 core %u\n", cpu);
> return IRQ_HANDLED;
> @@ -760,7 +760,6 @@ static int rzv2h_icu_setup_irqs(struct platform_device *pdev, struct irq_domain
> "int-ca55-2", "int-ca55-3",
> };
> static const char *icu_err = "icu-error-ca55";
> - static const u8 swint_idx[] = { 0, 1, 2, 3 };
> void __iomem *base = rzv2h_icu_data->base;
> struct device *dev = &pdev->dev;
> struct irq_fwspec fwspec;
> @@ -780,7 +779,7 @@ static int rzv2h_icu_setup_irqs(struct platform_device *pdev, struct irq_domain
> }
>
> ret = devm_request_irq(dev, virq, rzv2h_icu_swint_irq, 0, dev_name(dev),
> - (void *)&swint_idx[i]);
> + (void *)(uintptr_t)i);
> if (ret) {
> return dev_err_probe(dev, ret, "Failed to request %s IRQ\n",
> rzv2h_swint_names[i]);
> --
> 2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH 2/3] irqchip/renesas-rzv2h: Kill swint_names[]
2026-04-03 8:48 ` [PATCH 2/3] irqchip/renesas-rzv2h: Kill swint_names[] Geert Uytterhoeven
@ 2026-04-03 9:11 ` Biju Das
0 siblings, 0 replies; 6+ messages in thread
From: Biju Das @ 2026-04-03 9:11 UTC (permalink / raw)
To: Geert Uytterhoeven, Thomas Gleixner, Prabhakar Mahadev Lad
Cc: linux-renesas-soc, linux-kernel
Hi Geert,
Thanks for the patch
> -----Original Message-----
> From: Geert Uytterhoeven <geert+renesas@glider.be>
> Sent: 03 April 2026 09:48
> Subject: [PATCH 2/3] irqchip/renesas-rzv2h: Kill swint_names[]
>
> The array swint_names[] just contains expansions of "int-ca55-%u".
> Replace it by formatting the strings where needed, to improve readability.
>
> Despite the two error messages can no longer be shared with the ICU error cases, this reduces generated
> code size by 56 bytes.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Cheers,
Biju
> ---
> ---
> drivers/irqchip/irq-renesas-rzv2h.c | 14 ++++----------
> 1 file changed, 4 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/irqchip/irq-renesas-rzv2h.c b/drivers/irqchip/irq-renesas-rzv2h.c
> index 6fa8141adcaa59f2..d075196bdc741c7f 100644
> --- a/drivers/irqchip/irq-renesas-rzv2h.c
> +++ b/drivers/irqchip/irq-renesas-rzv2h.c
> @@ -755,10 +755,6 @@ static int rzv2h_icu_setup_irqs(struct platform_device *pdev, struct irq_domain {
> const struct rzv2h_hw_info *hw_info = rzv2h_icu_data->info;
> bool irq_inject = IS_ENABLED(CONFIG_GENERIC_IRQ_INJECTION);
> - static const char * const rzv2h_swint_names[] = {
> - "int-ca55-0", "int-ca55-1",
> - "int-ca55-2", "int-ca55-3",
> - };
> static const char *icu_err = "icu-error-ca55";
> void __iomem *base = rzv2h_icu_data->base;
> struct device *dev = &pdev->dev;
> @@ -774,16 +770,14 @@ static int rzv2h_icu_setup_irqs(struct platform_device *pdev, struct irq_domain
>
> virq = irq_create_fwspec_mapping(&fwspec);
> if (!virq) {
> - return dev_err_probe(dev, -EINVAL, "failed to create IRQ mapping for %s\n",
> - rzv2h_swint_names[i]);
> + return dev_err_probe(dev, -EINVAL,
> + "failed to create int-ca55-%u IRQ mapping\n", i);
> }
>
> ret = devm_request_irq(dev, virq, rzv2h_icu_swint_irq, 0, dev_name(dev),
> (void *)(uintptr_t)i);
> - if (ret) {
> - return dev_err_probe(dev, ret, "Failed to request %s IRQ\n",
> - rzv2h_swint_names[i]);
> - }
> + if (ret)
> + return dev_err_probe(dev, ret, "Failed to request int-ca55-%u
> +IRQ\n", i);
> }
>
> /* Unmask and clear all IP/CA55 error interrupts */
> --
> 2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-04-03 9:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-03 8:48 [PATCH 0/3] irqchip/renesas-rzv2h: Cleanups Geert Uytterhoeven
2026-04-03 8:48 ` [PATCH 1/3] irqchip/renesas-rzv2h: Kill swint_idx[] Geert Uytterhoeven
2026-04-03 9:10 ` Biju Das
2026-04-03 8:48 ` [PATCH 2/3] irqchip/renesas-rzv2h: Kill swint_names[] Geert Uytterhoeven
2026-04-03 9:11 ` Biju Das
2026-04-03 8:48 ` [PATCH 3/3] irqchip/renesas-rzv2h: Kill icu_err string Geert Uytterhoeven
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®