[tip: irq/drivers] irqchip/aclint-sswi: Reduce data scope

From: tip-bot2 for Vladimir Kondratiev
Date: Thu Jun 26 2025 - 10:17:57 EST


The following commit has been merged into the irq/drivers branch of tip:

Commit-ID: c8c8443a64a186df0508c709d51fe9c7db0b5d55
Gitweb: https://git.kernel.org/tip/c8c8443a64a186df0508c709d51fe9c7db0b5d55
Author: Vladimir Kondratiev <vladimir.kondratiev@xxxxxxxxxxxx>
AuthorDate: Thu, 12 Jun 2025 17:39:10 +03:00
Committer: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
CommitterDate: Thu, 26 Jun 2025 16:06:40 +02:00

irqchip/aclint-sswi: Reduce data scope

Move variables to the innermost scope where they are used

Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev@xxxxxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Link: https://lore.kernel.org/all/20250612143911.3224046-7-vladimir.kondratiev@xxxxxxxxxxxx

---
drivers/irqchip/irq-aclint-sswi.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/irqchip/irq-aclint-sswi.c b/drivers/irqchip/irq-aclint-sswi.c
index d9f28c0..9d8b19b 100644
--- a/drivers/irqchip/irq-aclint-sswi.c
+++ b/drivers/irqchip/irq-aclint-sswi.c
@@ -61,18 +61,18 @@ static int aclint_sswi_dying_cpu(unsigned int cpu)

static int __init aclint_sswi_parse_irq(struct fwnode_handle *fwnode, void __iomem *reg)
{
- struct of_phandle_args parent;
- unsigned long hartid;
- u32 contexts, i;
- int rc, cpu;
+ u32 contexts = of_irq_count(to_of_node(fwnode));

- contexts = of_irq_count(to_of_node(fwnode));
if (!(contexts)) {
pr_err("%pfwP: no ACLINT SSWI context available\n", fwnode);
return -EINVAL;
}

- for (i = 0; i < contexts; i++) {
+ for (u32 i = 0; i < contexts; i++) {
+ struct of_phandle_args parent;
+ unsigned long hartid;
+ int rc, cpu;
+
rc = of_irq_parse_one(to_of_node(fwnode), i, &parent);
if (rc)
return rc;