[PATCH v3 5/7] gpio: rtd1625: Narrow 'hwirq' variable scope in loop

From: Yu-Chun Lin

Date: Sun Aug 16 2026 - 11:18:34 EST


Declare 'hwirq' within the inner block where it's used to reduce variable
visibility.

Link: https://lore.kernel.org/lkml/anUcSPcJjJkLh0Z-@ashevche-desk.local/
Suggested-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
Signed-off-by: Yu-Chun Lin <eleanor.lin@xxxxxxxxxxx>
---
drivers/gpio/gpio-rtd1625.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-rtd1625.c b/drivers/gpio/gpio-rtd1625.c
index 2652bc6cb523..8f584287c2e6 100644
--- a/drivers/gpio/gpio-rtd1625.c
+++ b/drivers/gpio/gpio-rtd1625.c
@@ -225,7 +225,6 @@ static void rtd1625_gpio_irq_handle(struct irq_desc *desc)
unsigned int irq = irq_desc_get_irq(desc);
struct irq_domain *domain = data->domain;
unsigned int reg_offset, j, val;
- irq_hw_number_t hwirq;
unsigned long status;
u32 irq_type;
int ret;
@@ -267,7 +266,8 @@ static void rtd1625_gpio_irq_handle(struct irq_desc *desc)
}

for_each_set_bit(j, &status, 32) {
- hwirq = i + j;
+ irq_hw_number_t hwirq = i + j;
+
irq_type = irq_get_trigger_type(irq_find_mapping(domain, hwirq));

/*

--
2.50.1