[PATCH] irqchip/renesas-rzg2l: remove braces around single statement if block

Cosmin Tanislav posted 1 patch 3 months, 2 weeks ago
drivers/irqchip/irq-renesas-rzg2l.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH] irqchip/renesas-rzg2l: remove braces around single statement if block
Posted by Cosmin Tanislav 3 months, 2 weeks ago
Braces around single statement if blocks are unnecessary, remove them.

Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
---
 drivers/irqchip/irq-renesas-rzg2l.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-renesas-rzg2l.c
index 1bf19deb02c4..6e215649bf29 100644
--- a/drivers/irqchip/irq-renesas-rzg2l.c
+++ b/drivers/irqchip/irq-renesas-rzg2l.c
@@ -555,10 +555,9 @@ static int rzg2l_irqc_common_probe(struct platform_device *pdev, struct device_n
 		return dev_err_probe(dev, ret, "cannot parse interrupts: %d\n", ret);
 
 	resetn = devm_reset_control_get_exclusive_deasserted(dev, NULL);
-	if (IS_ERR(resetn)) {
+	if (IS_ERR(resetn))
 		return dev_err_probe(dev, PTR_ERR(resetn),
 				     "failed to acquire deasserted reset: %d\n", ret);
-	}
 
 	ret = devm_pm_runtime_enable(dev);
 	if (ret)
-- 
2.51.1.dirty
Re: [PATCH] irqchip/renesas-rzg2l: remove braces around single statement if block
Posted by Thomas Gleixner 3 months, 2 weeks ago
On Wed, Oct 22 2025 at 10:35, Cosmin Tanislav wrote:
> Braces around single statement if blocks are unnecessary, remove them.
>
> Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
> ---
>  drivers/irqchip/irq-renesas-rzg2l.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-renesas-rzg2l.c
> index 1bf19deb02c4..6e215649bf29 100644
> --- a/drivers/irqchip/irq-renesas-rzg2l.c
> +++ b/drivers/irqchip/irq-renesas-rzg2l.c
> @@ -555,10 +555,9 @@ static int rzg2l_irqc_common_probe(struct platform_device *pdev, struct device_n
>  		return dev_err_probe(dev, ret, "cannot parse interrupts: %d\n", ret);
>  
>  	resetn = devm_reset_control_get_exclusive_deasserted(dev, NULL);
> -	if (IS_ERR(resetn)) {
> +	if (IS_ERR(resetn))
>  		return dev_err_probe(dev, PTR_ERR(resetn),
>  				     "failed to acquire deasserted reset: %d\n", ret);
> -	}

No. That's visual garbage and breaks the reading flow as the lack of
brackets indicates that there is a single line following after the if():

         if (cond)
         	foo();

is perfectly readable but

        if (cond)
                foo(................................,
                        ............................);

is not.

You are right, C does not require the brackets for the single
statement. But humans read in patterns and the expected pattern for a
if() or for() is that if it has no brackets then there follows a single
line statement. If that pattern is not there the reading flow is
disturbed.

Thanks,

        tglx
Re: [PATCH] irqchip/renesas-rzg2l: remove braces around single statement if block
Posted by Geert Uytterhoeven 3 months, 2 weeks ago
On Wed, 22 Oct 2025 at 09:36, Cosmin Tanislav
<cosmin-gabriel.tanislav.xa@renesas.com> wrote:
> Braces around single statement if blocks are unnecessary, remove them.
>
> Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>

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