lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87jz0mykm3.ffs@tglx>
Date: Wed, 22 Oct 2025 18:19:48 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@...esas.com>
Cc: Fabrizio Castro <fabrizio.castro.jz@...esas.com>, Lad Prabhakar
 <prabhakar.mahadev-lad.rj@...renesas.com>, Geert Uytterhoeven
 <geert+renesas@...der.be>, linux-kernel@...r.kernel.org, Cosmin Tanislav
 <cosmin-gabriel.tanislav.xa@...esas.com>
Subject: Re: [PATCH] irqchip/renesas-rzg2l: remove braces around single
 statement if block

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@...esas.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ