The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Cc: Fabrizio Castro <fabrizio.castro.jz@renesas.com>,
	Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	linux-kernel@vger.kernel.org,
	Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Subject: Re: [PATCH] irqchip/renesas-rzg2l: remove braces around single statement if block
Date: Wed, 22 Oct 2025 18:19:48 +0200	[thread overview]
Message-ID: <87jz0mykm3.ffs@tglx> (raw)
In-Reply-To: <20251022073558.1992384-1-cosmin-gabriel.tanislav.xa@renesas.com>

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

      parent reply	other threads:[~2025-10-22 16:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22  7:35 [PATCH] irqchip/renesas-rzg2l: remove braces around single statement if block Cosmin Tanislav
2025-10-22  9:23 ` Geert Uytterhoeven
2025-10-22 16:19 ` Thomas Gleixner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87jz0mykm3.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=cosmin-gabriel.tanislav.xa@renesas.com \
    --cc=fabrizio.castro.jz@renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=linux-kernel@vger.kernel.org \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox