drivers/i2c/busses/i2c-riic.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Refactor the IRQ handling in riic_i2c_probe by introducing a local variable
`irq` to store IRQ numbers instead of assigning them to `ret`. This change
improves code readability and clarity.
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
Note, this patch is part of series [0], as requested by Andi, sending
only patch 1/9 from series [0].
[0] https://lore.kernel.org/all/20250103091900.428729-1-prabhakar.mahadev-lad.rj@bp.renesas.com/
v4->v5
- validate return value of platform_get_irq()
---
drivers/i2c/busses/i2c-riic.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-riic.c b/drivers/i2c/busses/i2c-riic.c
index 9264adc97ca9..9809ac095710 100644
--- a/drivers/i2c/busses/i2c-riic.c
+++ b/drivers/i2c/busses/i2c-riic.c
@@ -464,11 +464,13 @@ static int riic_i2c_probe(struct platform_device *pdev)
return ret;
for (i = 0; i < ARRAY_SIZE(riic_irqs); i++) {
- ret = platform_get_irq(pdev, riic_irqs[i].res_num);
- if (ret < 0)
- return ret;
+ int irq;
+
+ irq = platform_get_irq(pdev, riic_irqs[i].res_num);
+ if (irq < 0)
+ return irq;
- ret = devm_request_irq(dev, ret, riic_irqs[i].isr,
+ ret = devm_request_irq(dev, irq, riic_irqs[i].isr,
0, riic_irqs[i].name, riic);
if (ret) {
dev_err(dev, "failed to request irq %s\n", riic_irqs[i].name);
--
2.43.0
On Thu, Jan 9, 2025 at 11:12 PM Prabhakar <prabhakar.csengg@gmail.com> wrote: > > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > > Refactor the IRQ handling in riic_i2c_probe by introducing a local variable > `irq` to store IRQ numbers instead of assigning them to `ret`. This change > improves code readability and clarity. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Andi, perhaps you may apply this one to reduce potential confusion / ambiguity with v5 numbering and Prabhakar can then be focused on the rest. -- With Best Regards, Andy Shevchenko
On Thu, Jan 9, 2025 at 10:12 PM Prabhakar <prabhakar.csengg@gmail.com> wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> Refactor the IRQ handling in riic_i2c_probe by introducing a local variable
> `irq` to store IRQ numbers instead of assigning them to `ret`. This change
> improves code readability and clarity.
>
> Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> ---
> Note, this patch is part of series [0], as requested by Andi, sending
> only patch 1/9 from series [0].
>
> [0] https://lore.kernel.org/all/20250103091900.428729-1-prabhakar.mahadev-lad.rj@bp.renesas.com/
>
> v4->v5
> - validate return value of platform_get_irq()
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
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
On Thu, Jan 09, 2025 at 09:12:05PM +0000, Prabhakar wrote: > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> > > Refactor the IRQ handling in riic_i2c_probe by introducing a local variable > `irq` to store IRQ numbers instead of assigning them to `ret`. This change > improves code readability and clarity. > > Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> If you guys like it... Testing not possible this week anymore. Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
© 2016 - 2026 Red Hat, Inc.